You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P-C2] Parser: infinite loop on unterminated blocks #2
Many while self.current_token.type != TokenType.RBRACE: loops in src/flow/parser.py (lines ~924, 972, 1004, 1040, 1100, 1370, 1408, 1444) never check for TokenType.EOF.
If the input ends without a closing brace (e.g., truncated file), the parser loops forever because next_token() keeps returning the same EOF token, but the loop condition never becomes true.
Fixed: added EOF guards to all 10 while != RBRACE loops in the parser. The parser now raises SyntaxError('Unterminated ... expected } before end of file') instead of looping forever on truncated input.
Activity
Add GH issue sync script and mark #1/#2
godofecht commentedon Feb 9, 2026
Fixed: added EOF guards to all 10
while != RBRACEloops in the parser. The parser now raisesSyntaxError('Unterminated ... expected } before end of file')instead of looping forever on truncated input.