mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
add parser rule to catch old-style Range query
This commit is contained in:
parent
927e8b8942
commit
5458a42ad0
3 changed files with 1396 additions and 1231 deletions
|
|
@ -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
|
||||
|
|
|
|||
2622
pql/pql.peg.go
2622
pql/pql.peg.go
File diff suppressed because it is too large
Load diff
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue