Skip to content

Change +, -, *, /, //, and % operators' associativity to left-to-right#280

Merged
rmorozov merged 2 commits intojinja2cpp:masterfrom
6aJIaJIae4HuK:fix_associativity
Mar 10, 2026
Merged

Change +, -, *, /, //, and % operators' associativity to left-to-right#280
rmorozov merged 2 commits intojinja2cpp:masterfrom
6aJIaJIae4HuK:fix_associativity

Conversation

@6aJIaJIae4HuK
Copy link
Copy Markdown
Contributor

Before:

  • Expressions like 10 - 2 - 4 parsed as 10 - (2 - 4) instead of more convenient (10 - 2) - 4
  • Expressions like 200 / 2 / 2 parsed as 100 / (2 / 2) instead of more convenient (200 / 2) / 2

Now:

  • Fixed it
  • Added corresponding test

@6aJIaJIae4HuK
Copy link
Copy Markdown
Contributor Author

@rmorozov, hi, can you take a look plz?

@6aJIaJIae4HuK
Copy link
Copy Markdown
Contributor Author

:(

@rmorozov
Copy link
Copy Markdown
Member

@6aJIaJIae4HuK , sorry, have my first baby born and had no time for optional activities=)

I have big review where I rework logics for internal json parser and dump 3rd party code as well - #279

I plan to bring it to master in these Christmas/New Year holidays and restore pull request build as well, then merge your PR and issue new release

@rmorozov rmorozov marked this pull request as draft March 10, 2026 15:09
@rmorozov rmorozov marked this pull request as ready for review March 10, 2026 15:09
@rmorozov rmorozov merged commit 6bcb9b1 into jinja2cpp:master Mar 10, 2026
1 check passed
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.

2 participants