sqltoast
sqltoast copied to clipboard
Robustify syntax error reporting
Due the various things, including how the lexer's cursor is moved over time, sometimes the syntax errors produced when a parsing problem happens can be confusing. Por ejemplo:
./sqltoaster/sqltoaster "SELECT NULLIF(a, b) FROM t1"
OK
statements[0]:
<statement: SELECT
selected columns:
0: nullif[column-reference[a],column-reference[b]]
referenced tables:
0: t1>
(took 73006 nanoseconds)
If I remove the a,b arguments accidentally, I get the following parser syntax error:
./sqltoaster/sqltoaster "SELECT NULLIF() FROM t1"
Syntax error.
Expected to find one of ('*'|<< identifier >>) but found symbol[')']
SELECT NULLIF() FROM t1
^^^^^^^^^^
(took 78092 nanoseconds)
What should be there is a message about how a