Skip to content

Fix #12052: Tokenize arithmetic operators as delimiters in ConditionParser#12053

Open
gnodet wants to merge 1 commit into
masterfrom
fix/condition-parser-arithmetic-delimiters
Open

Fix #12052: Tokenize arithmetic operators as delimiters in ConditionParser#12053
gnodet wants to merge 1 commit into
masterfrom
fix/condition-parser-arithmetic-delimiters

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 14, 2026

Summary

  • Add -, *, / to the delimiter character list in ConditionParser.tokenize() so arithmetic expressions without spaces (e.g., 5-3, 6*4, 9/3) are correctly tokenized
  • This is safe because quoted strings and property references (${my-property}) are handled before the delimiter check, and parseUnary() already handles unary -

Fixes #12052
Related: #11882, #12038

Test plan

  • Added testArithmeticWithoutSpaces covering all operators without spaces, operator precedence, and unary negation
  • All 27 ConditionParserTest tests pass

Claude Code on behalf of Guillaume Nodet

…arser

The tokenizer did not recognize `-`, `*`, `/` as delimiter characters,
so expressions like `5-3` or `6*4` (without spaces) were tokenized as
single tokens and failed to parse.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

ConditionParser: tokenize arithmetic operators as delimiters

1 participant