Skip to content

Conversation

@msujew
Copy link
Member

@msujew msujew commented Dec 4, 2025

Closes #2075

Simply uses the getTypeName function to get the expected name of the AST node.


private registerPrecedenceMap(rule: InfixRule): void {
const name = rule.name;
const name = getTypeName(rule);

Choose a reason for hiding this comment

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

does this work? in theory, you could have different rules with different precedences which however return the same type

sth like

infix OperatorExpression on IdExpression returns ComplexExpression:
    '*' | '/'
    > '+' | '-';

infix OperatorExpression2 on IdExpression returns ComplexExpression:
    '%'
    > '^';

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess that makes sense, thanks 👍

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.

Infix rules with explicit return type do not use that type in the AstNode

3 participants