Skip to content

Conversation

@AlexandrosAlexiou
Copy link

@AlexandrosAlexiou AlexandrosAlexiou commented Nov 19, 2025

…ators

Enables prefix expressions with assignment operators.

Problem:
Could not parse prefix expressions with assignment operators:
++x += 5 // ERROR
--arr[i] *= 2 // ERROR

Missing assignableExpression rule from ANTLR grammar.

Changes:

  • assignment: Added assignable_expression with assignment operators
  • assignable_expression: prefix_expression | parenthesized variant
  • parenthesized_assignable_expression: Wrapped variant
  • conflicts: Added _unary_expression ambiguity resolution

Example:
++x += 5 --arr[i] *= 2 (++count) /= 3

Matches ANTLR:
assignableExpression : prefixUnaryExpression | parenthesizedAssignableExpression

This completes 100% functional parity with ANTLR grammar.

Tests: 111/111 pass

…ators (100% functional parity)

Enables prefix expressions with assignment operators.

Problem:
Could not parse prefix expressions with assignment operators:
  ++x += 5       // ERROR
  --arr[i] *= 2  // ERROR

Missing assignableExpression rule from ANTLR grammar.

Changes:
- assignment: Added assignable_expression with assignment operators
- assignable_expression: prefix_expression | parenthesized variant
- parenthesized_assignable_expression: Wrapped variant
- conflicts: Added _unary_expression ambiguity resolution

Example:
  ++x += 5
  --arr[i] *= 2
  (++count) /= 3

Matches ANTLR:
  assignableExpression
    : prefixUnaryExpression
    | parenthesizedAssignableExpression

This completes 100% functional parity with ANTLR grammar.

Tests: 111/111 pass
@github-actions github-actions bot added the grammar Related to the grammar label Nov 19, 2025
@VladimirMakaev
Copy link
Collaborator

Hi @AlexandrosAlexiou thanks for all your PRs. I ran CI on each one of them it's mostly failing. Please check the setup and try to make it pass. I believe the CI checks that whatever generated file you sent matches exactly what's being generated from scratch. Unfortunately I can't help you debug the CI

@AlexandrosAlexiou
Copy link
Author

Hi @AlexandrosAlexiou thanks for all your PRs. I ran CI on each one of them it's mostly failing. Please check the setup and try to make it pass. I believe the CI checks that whatever generated file you sent matches exactly what's being generated from scratch. Unfortunately I can't help you debug the CI

Hello, I did not commit some stuff, can you please check again?

@VladimirMakaev
Copy link
Collaborator

@AlexandrosAlexiou please also add tests for all the grammar elements you've implemented. There is also a size check on the parser imposed by @fwcd. I believe it's not easy to make more changes to the grammar without refactoring it. I don't really have any good suggestions for you how to proceed.

@AlexandrosAlexiou
Copy link
Author

@AlexandrosAlexiou please also add tests for all the grammar elements you've implemented. There is also a size check on the parser imposed by @fwcd. I believe it's not easy to make more changes to the grammar without refactoring it. I don't really have any good suggestions for you how to proceed.

Cool, thanks for the info, will take a look in my free time.

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

Labels

grammar Related to the grammar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants