gerrit/antlr3
Dave Borowitz 12e3757e3b QueryBuilder: Support : in field values
Prior to this change, "field:foo:bar" is parsed as "field:foo", silently
discarding the ":bar". Worse, "field:foo:bar baz:quux" is _also_ parsed
as "field:foo", discarding not just part of the first term but the
entire second term.

Fix this by treating "SINGLE_WORD ':' fieldValue" as a valid definition
of a field value, and add tests.

This solution seems inelegant in general; it seems like we should be
able to concatenate the tokens together into a single AST node at the
Antlr level. Also, it doesn't work in all cases: it fails to parse field
values ending in ':'

I'm far from an Antlr expert and there may be a better/easier way to do
this. But this change is still strictly better than it was before, and
it sets an example of how to write tests for parser functionality.

Change-Id: If275623b3244b02f81114fb2997ba16ee1492a4f
2019-03-25 13:28:14 -07:00
..
com/google/gerrit/index/query QueryBuilder: Support : in field values 2019-03-25 13:28:14 -07:00
BUILD Add TreeSubject over antlr3 trees 2019-03-25 13:28:14 -07:00