Skip to content

Implement compound arithmetic operators #30

@LefterisJP

Description

@LefterisJP

Compound arithmetic operators (+=, -=, *=, /=) are missing from the language at the moment.

This is an issue to track the implementation of their addition to the language.
TODO:

  • Add the appropriate lexer tokens to the lexer.
  • Test scanning of those tokens in the lexer.
  • Add them to the parsing stage during the AST generation
  • Test the parsing and AST generation of compound operators.
  • Do the same typechecking their non-compound binary operator equivalent does.
  • Make tests for the above.
  • Generate RIR and backend code for the compound operators in the same way the arithmetic
    binary operators do.
  • Add end to end backend tests

Note: This issue requires a lot of work, but is quite easy to do since the logic already exists throughout the code for the arithmetic operators. So implementation is just looking at what already exists and duplicating it with some modification.

For that reason it could be a nice deep-dive introduction to the codebase for someone who wants to learn how refu works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions