Skip to content

Fix statement splitting after whitespace-varied compound closers - #936

Open
AryanRG wants to merge 1 commit into
andialbrecht:masterfrom
AryanRG:fix/compound-closing-keyword-whitespace
Open

AryanRG wants to merge 1 commit into
andialbrecht:masterfrom
AryanRG:fix/compound-closing-keyword-whitespace

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026

Copy link
Copy Markdown

Compound block closing keywords such as END IF and END LOOP can contain repeated spaces, tabs, or line breaks. The lexer recognizes those spellings, but the statement splitter compares their raw whitespace against single-space keywords. It then leaves the block open and merges later statements.

Normalize only the keyword value used for splitter comparisons. The original token text is unchanged. Add regression coverage for five closer types, four separators, anonymous and procedure blocks, and two following statements; update the development changelog.

Validation:

  • New regression cases on pristine master: 30 failed, 10 single-space controls passed.
  • With this change: all 40 regression cases passed.
  • Full tests on Python 3.10, 3.11, and 3.14: 546 passed, 2 expected failures, 1 existing non-strict unexpected pass on each.
  • Ruff and diff checks passed.

AI assistance was used to investigate, implement, test, and review this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant