cloudspannerecosystem / memefish

memefish is the foundation to analyze Spanner SQL
https://cloudspannerecosystem.dev/memefish/
MIT License
76 stars 19 forks source link

Sync lexer punctuations with ZetaSQL #181

Closed apstndb closed 2 weeks ago

apstndb commented 2 weeks ago

Some punctuations are not yet handled in memefish.Lexer. It cause panic when lexing even if parsing is not needed.

I think it is safe to add all punctuations in ZetaSQL.

https://github.com/google/zetasql/blob/194cd32b5d766d60e3ca442651d792c7fe54ea74/zetasql/parser/flex_tokenizer.l#L513-L552

Except MACRO_INVOCATION and MACRO_ARGUMENT_REFERENCE would be better to be implemented.

This makes Lexer more robust even to new lexical structures that are being tested privately.