Skip to content

Commit 11525b6

Browse files
Benoit Aubuchonclaude
andcommitted
fix: correct prev_ok word-boundary check in find_top_level_keyword
abs_pos == from skipped the boundary check for keywords at the scan start when from > 0. The second branch (text[..abs_pos].chars().next_back()) already handles abs_pos == 0 correctly via unwrap_or(true), so drop the short-circuit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fe13f8c commit 11525b6

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

apps/framework-cli/src/framework/core/infra_reality_checker.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,12 @@ fn dicts_ddl_equivalent(actual_ddl: &str, desired_ddl: &str) -> bool {
220220
_ if depth == 0 => {
221221
for &kw in keywords {
222222
if text[abs_pos..].starts_with(kw) {
223-
// Require a word boundary before (start or non-alnum/underscore)
224-
let prev_ok = abs_pos == from
225-
|| text[..abs_pos]
226-
.chars()
227-
.next_back()
228-
.map(|p| !p.is_alphanumeric() && p != '_')
229-
.unwrap_or(true);
223+
// Require a word boundary before (start of text or non-alnum/underscore)
224+
let prev_ok = text[..abs_pos]
225+
.chars()
226+
.next_back()
227+
.map(|p| !p.is_alphanumeric() && p != '_')
228+
.unwrap_or(true);
230229
// Require a word boundary after (end or non-alnum/underscore)
231230
let after = abs_pos + kw.len();
232231
let next_ok = text[after..]

0 commit comments

Comments
 (0)