datacamp / antlr-plsql

GNU Affero General Public License v3.0
17 stars 14 forks source link

cleanup grammar to fix bug omitting in elements from AST #10

Closed machow closed 7 years ago

filipsch commented 7 years ago

Could you provide some context here? :)

machow commented 7 years ago

@filipsch the classes for generating ASTs use the names of grammar rules to decide what to put on the AST. In this case, the IN expression is created as a BinaryExpr, by using the rules named left, op, and right. However, I forgot to either tell BinaryExpr to grab in_elements or to rename it to right using right=in_elements for the rule below. This caused it to leave off in_elements completely.

left=expression NOT? op=IN in_elements                                  # InExpr

(when I fixed the bug I simplified in_elements to be consistent with the postgres parser)

filipsch commented 7 years ago

@machow okay, thanks!