Skip to content

feat(compiler): support increment and decrement operators (#36) - #47

Merged
sql-hkr merged 1 commit into
mainfrom
feat/inc-dec-operators
Oct 26, 2026
Merged

sql-hkr merged 1 commit into
mainfrom
feat/inc-dec-operators

Conversation

@sql-hkr

@sql-hkr sql-hkr commented Oct 26, 2026

Copy link
Copy Markdown
Owner
  • Add \+\+|-- tokens to Lexer.TOKEN_SPEC.
  • Add IncDec AST node for prefix and postfix ++ and --.
  • Update Parser.parse_unary, parse_postfix, parse_inline_post, and parse_stmt to support prefix and postfix increment and decrement expressions and statements.
  • Generate AVR INC and DEC instructions in CodeGenerator, returning the new value in R16 for prefix and the old value in R16 for postfix.
  • Add comprehensive test coverage in tests/test_compiler.py.

Closes #36

)

- Add `\+\+|--` tokens to `Lexer.TOKEN_SPEC`.
- Add `IncDec` AST node for prefix and postfix `++` and `--`.
- Update `Parser.parse_unary`, `parse_postfix`, `parse_inline_post`, and `parse_stmt` to support prefix and postfix increment and decrement expressions and statements.
- Generate AVR `INC` and `DEC` instructions in `CodeGenerator`, returning the new value in R16 for prefix and the old value in R16 for postfix.
- Add comprehensive test coverage in `tests/test_compiler.py`.

Closes #36
@sql-hkr
sql-hkr merged commit fa92557 into main Oct 26, 2026
@sql-hkr
sql-hkr deleted the feat/inc-dec-operators branch October 26, 2026 14:34
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.

feat(compiler): support increment and decrement operators (++ / --)

1 participant