mirror of
https://github.com/pikami/cosmium.git
synced 2025-03-26 03:28:38 +00:00
Fix 'ComparisonOperator' parsing
This commit is contained in:
parent
14c5400d23
commit
6e3f4169a1
@ -2107,40 +2107,40 @@ var g = &grammar{
|
||||
alternatives: []any{
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 24, offset: 11503},
|
||||
val: "=",
|
||||
ignoreCase: false,
|
||||
want: "\"=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 30, offset: 11509},
|
||||
val: "!=",
|
||||
ignoreCase: false,
|
||||
want: "\"!=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 37, offset: 11516},
|
||||
val: "<",
|
||||
ignoreCase: false,
|
||||
want: "\"<\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 43, offset: 11522},
|
||||
val: "<=",
|
||||
ignoreCase: false,
|
||||
want: "\"<=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 50, offset: 11529},
|
||||
val: ">",
|
||||
ignoreCase: false,
|
||||
want: "\">\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 56, offset: 11535},
|
||||
pos: position{line: 406, col: 31, offset: 11510},
|
||||
val: ">=",
|
||||
ignoreCase: false,
|
||||
want: "\">=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 38, offset: 11517},
|
||||
val: "=",
|
||||
ignoreCase: false,
|
||||
want: "\"=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 44, offset: 11523},
|
||||
val: "!=",
|
||||
ignoreCase: false,
|
||||
want: "\"!=\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 51, offset: 11530},
|
||||
val: "<",
|
||||
ignoreCase: false,
|
||||
want: "\"<\"",
|
||||
},
|
||||
&litMatcher{
|
||||
pos: position{line: 406, col: 57, offset: 11536},
|
||||
val: ">",
|
||||
ignoreCase: false,
|
||||
want: "\">\"",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -403,7 +403,7 @@ OrderBy <- "ORDER"i ws "BY"i
|
||||
|
||||
Offset <- "OFFSET"i
|
||||
|
||||
ComparisonOperator <- ("=" / "!=" / "<" / "<=" / ">" / ">=") {
|
||||
ComparisonOperator <- ("<=" / ">=" / "=" / "!=" / "<" / ">") {
|
||||
return string(c.text), nil
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ func Test_Parse_Were(t *testing.T) {
|
||||
t,
|
||||
`select c.id
|
||||
FROM c
|
||||
WHERE c.isCool=true AND (c.id = "123" OR c.id = "456")`,
|
||||
WHERE c.isCool=true AND (c.id = "123" OR c.id <= "456")`,
|
||||
parsers.SelectStmt{
|
||||
SelectItems: []parsers.SelectItem{
|
||||
{Path: []string{"c", "id"}},
|
||||
@ -90,7 +90,7 @@ func Test_Parse_Were(t *testing.T) {
|
||||
Right: testutils.SelectItem_Constant_String("123"),
|
||||
},
|
||||
parsers.ComparisonExpression{
|
||||
Operation: "=",
|
||||
Operation: "<=",
|
||||
Left: parsers.SelectItem{Path: []string{"c", "id"}},
|
||||
Right: testutils.SelectItem_Constant_String("456"),
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user