gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
29 stars 28 forks source link

Possible v2.1 parser bug related to != operator #142

Closed mbtaylor closed 1 year ago

mbtaylor commented 1 year ago

Consider the following ADQL:

SELECT c FROM t WHERE c!=0

This parses without errors using the v2.0 parser (java -jar adqlParser.jar --version=v2.0) but if I try it using the v2.1 parser (branch adql2.1, java -jar adqlParser.jar --version=v2.1) I get the following error:

((X)) Syntax error: Invalid ADQL regular identifier: "c!"!
 (HINT: If it aims to be a column/table name/alias, you should write it between double quotes.) ((X))

Is this expected?

gmantele commented 1 year ago

Not really. I guess you get this error only if there is no space between c and !.

I assume this happens because I try to match bad and good column identifiers so that I can give an understandable error message and an appropriate hint....exactly what you've got.

I think the easy solution should be to remove the ! from the characters I temporarily accept.

mbtaylor commented 1 year ago

OK, it's not going to be a very common error, but I noticed it in one of Markus's service-provided examples and thought it might be worth looking into. But I leave it to you whether to fix or ignore it.

gmantele commented 1 year ago

Should be ok now. Thanks for all these feedbacks.

mbtaylor commented 1 year ago

Thank you, fix confirmed.