google / badwolf

Temporal graph store abstraction layer.
Apache License 2.0
983 stars 66 forks source link

Use lexer.ItemTime instead of lexer.ItemPredicate for AFTER and BEFORE clauses #136

Closed rogerlucena closed 4 years ago

rogerlucena commented 4 years ago

Previously, in AFTER and BEFORE clauses the timestamp that came after these keywords was understood as a lexer.ItemPredicate token in the code.

This PR, then, comes to create a new token type: the lexer.ItemTime, and use it for the AFTER and BEFORE global time bound clauses, making the code cleaner.

This PR also comes to add missing tests for AFTER and BEFORE in lexer_test.go.

rogerlucena commented 4 years ago

I recon we already had tests for this syntax in the planner, right? If not, do you mind adding them, please?

@rbkloss we have indeed, but I have just added two more there in planner_test.go to also test the case on which the AFTER/BEFORE clauses do not terminate with ; (not being the last ones of the query, followed by LIMIT there).