datacamp/antlr-plsql

Bad support for aliases inside join statements

filipsch opened this issue · 4 comments

Look at this example. The alias of the inner join is parsed properly, but the tree representation turns it into an Unshaped node while it should be an AliasExpr.

@machow The plsql.g4 file doesn't need changing for this, I think, but the ast.py file does. Is this correct? Do you have time to pair on this at some point?

@filipsch I'm probably doing something wrong but I can't see the unshaped node. Happy to pair whenever is useful!

image

@machow Sorry, had a wrong example in there. This example would show it:

SELECT a FROM co AS c INNER JOIN ec AS e ON c.code = e.code

image

Ah, I think that's the alias piece I mention in issue #30

  1. implement some AST structure for table aliases (see this query)

This is what it looks like now:
Screenshot 2019-03-25 at 23 56 04

ast-viewer