Closed xianlinc closed 5 months ago
On a side note, I can't seem to label the issue due to lack of permissions 🫡
Wow missed this one out. Thank you! Going to fix it tomorrow
Alright @xianlinc it's resolved! Merging in soon the fix into the main. Thanks again for finding this out!
Context
Found a bug while trying to print an index access node in the AST.
source code:
myArray[idx]
Expected:myArray[idx]
Actual:idx[myArray]
Problem
I think that the
(i *IndexAccess) Parse
method has a bug where the index and base expressions are swapped.Currently:
i.IndexExpression
->ctx.Expression(0)
i.BaseExpression
->ctx.Expression(1)
Should be:
i.IndexExpression
->ctx.Expression(1)
i.BaseExpression
->ctx.Expression(0)