add parser rule to catch old-style Range query

This commit is contained in:
Matt Jaffee 2019-04-04 19:42:09 -05:00
parent 927e8b8942
commit 5458a42ad0
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
3 changed files with 1396 additions and 1231 deletions

View file

@ -14,6 +14,7 @@ Call <- 'Set' {p.startCall("Set")} open col comma args (comma timestamp)? close
/ 'Store' {p.startCall("Store")} open Call comma arg close {p.endCall()}
/ 'TopN' {p.startCall("TopN")} open posfield (comma allargs)? close {p.endCall()}
/ 'Rows' {p.startCall("Rows")} open posfield (comma allargs)? close {p.endCall()}
/ 'Range' {p.startCall("Range")} open field sp '=' sp value comma 'from='? {p.addField("from")} timestampfmt {p.addVal(buffer[begin:end])} comma 'to='? sp {p.addField("to")} timestampfmt {p.addVal(buffer[begin:end])} close {p.endCall()}
/ < IDENT > { p.startCall(buffer[begin:end] ) } open allargs comma? close { p.endCall() }
allargs <- Call (comma Call)* (comma args)? / args / sp
args <- arg (comma args)? sp

File diff suppressed because it is too large Load diff

View file

@ -267,6 +267,10 @@ func TestPEGWorking(t *testing.T) {
my-frame
=9)`,
ncalls: 1},
{
name: "OldRange",
input: "Range(blah=1, 2019-04-07T00:00, 2019-08-07T00:00)",
ncalls: 1},
}
for i, test := range tests {