forward / sql-parser

A SQL parser written in pure JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parameterless function call

haskellcamargo opened this issue · comments

Parameterless function calls generate an error.
`"SELECT X(Y(Z())) AS TOTAL FROM STJ TBL"``

Dies in Unexpected 'RIGHT_PAREN', while

`"SELECT X(Y(Z)) AS TOTAL FROM STJ TBL"``

Works fine.

I'll try to fix it in the Jison grammar and submit a pull-request.

Please, note that there are some ambiguities in the current defined grammar. The current version of Jison gives us warnings about them.
But this can be trivially solved by adding a new production to UserFunction:

o "LITERAL LEFT_PAREN RIGHT_PAREN", -> new FunctionValue($1, [], true)