Skip to content

Commit

Permalink
special treatment for OOP style function call, it now only support NA…
Browse files Browse the repository at this point in the history
…ME in the left, not EXPR
  • Loading branch information
Tengs Penkwe committed Feb 21, 2024
1 parent 4cd63a9 commit 7eb8136
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/Trans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class TransVisitor extends FarmExprVisitor<ASTNode> {
return new BinaryExpression("Or", left, right);
case ".":
if (!(right instanceof CallExpression)) throw new Error("Right expression should be CallExpression");
return new OOPCallExpression(left, (right as CallExpression).name, (right as CallExpression).args);
return new OOPCallExpression(new NameExpression(ctx.getChild(0).getText()), (right as CallExpression).name, (right as CallExpression).args);
default:
throw new Error(`Unknown operator ${op}`);
}
Expand Down

0 comments on commit 7eb8136

Please sign in to comment.