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
mini_parser: trailing whitespace and malformed conditions raise IndexError/KeyError #65
The condition mini-parser raises unexpected exceptions for several inputs. In particular, adding trailing whitespace to an otherwise valid condition causes an IndexError. A missing closing parenthesis and adjacent operands raise IndexError and KeyError instead of a useful syntax error. These exceptions propagate through AnnotationElementConditionEval(condition=...).
Trailing whitespace should not change the result of a valid condition. Malformed conditions should raise a clear ValueError rather than exposing internal IndexError or KeyError exceptions.
Source analysis
Lexer.next_token() checks for end of input before skipping whitespace, then indexes the input without checking again.
Activity
xupinjie commentedon Oct 12, 2026
@RmSchaffert can help fix this issue.