Skip to content

Conversation

@LeanSerra
Copy link
Owner

Description

Modify grammar.rustemo file to use named rules, this way instead of having confusing names for the possible rules:

pub enum Expressions {
    Expression(Expression),
    C2(ExpressionsC2),

we have more useful names like

pub enum Expressions {
   ExpressionSingle(Expression),
   ExpressionRecursive(ExpressionRecursive),
}

Also moves all the compiler context to a file named context.rs that will initialize all the necessary context for the compiler inside a thread_local! macro
Finally this PR adds the recursive rule for declaring multiple variables in a single line like a, b, c : int this is required for creating the symbol table.

@LeanSerra LeanSerra self-assigned this Sep 1, 2025
Copy link
Collaborator

@MatiBarcia MatiBarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LeanSerra LeanSerra merged commit f6e8113 into main Sep 1, 2025
2 checks passed
@LeanSerra LeanSerra deleted the refactor/named_rustemo_actions_compiler_context branch September 1, 2025 01:51
@LeanSerra LeanSerra removed their assignment Sep 1, 2025
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.

3 participants