usagi-coffee / tree-sitter-abl

OpenEdge ABL grammar for tree-sitter
MIT License
5 stars 1 forks source link

Ternary expressions not being parsed correctly #48

Closed PauliusKu closed 3 weeks ago

PauliusKu commented 3 weeks ago

First example:

c = (IF I < 5 THEN "low" ELSE "high").

In this case, it works (parsed both ternary_expression and parenthesized_expression). image

Second example:

FOR EACH Customer NO-LOCK BY IF Customer.Balance > 10000 THEN 1
  ELSE (IF Customer.Balance > 1000 THEN 2 ELSE 3) BY Customer.SalesRep:
  DISPLAY Customer.SalesRep Customer.Balance Customer.Name.
END.

Here, the first IF function is not parsed at all (no ternary_expression). image

However, the second IF function is parsed as ternary_expression yet not as parenthesized_expression, even though there are parentheses around it. image