This repository was archived by the owner on Jul 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +50
-40
lines changed
Expand file tree Collapse file tree 3 files changed +50
-40
lines changed Original file line number Diff line number Diff line change 55- [ ] Missing specs
66
77- [ ] Expression grouping issues
8- ``` sql
9- ` anger` != null AND NOT ` happiness`
10- ```
8+ - [x] Grouping with unary and binary expressions
119
12- ``` sql
13- ` happiness ` NOT NULL AND ` anger ` > 0
14- ```
10+ ``` sql
11+ ` anger ` != null AND NOT ` happiness `
12+ ```
1513
16- ``` sql
17- ` happiness` IS NOT NULL AND ` anger` > 0
18- ```
14+ ` ` ` sql
15+ ` happiness` NOT NULL AND ` anger` > 0
16+ ` ` `
1917
20- ``` sql
21- ` happiness` ISNULL AND ` anger` >
22- ```
18+ ` ` ` sql
19+ ` happiness` IS NOT NULL AND ` anger` > 0
20+ ` ` `
2321
24- ``` sql
25- ` anger ` > 0 AND ` happiness ` IS NOT NULL
26- ```
22+ ` ` ` sql
23+ ` happiness ` ISNULL AND ` anger ` >
24+ ` ` `
2725
28- ``` sql
29- NOT ` happiness` AND ` anger` > 0
30- ```
26+ ` ` ` sql
27+ ` anger` > 0 AND ` happiness` IS NOT NULL
28+ ` ` `
29+
30+ ` ` ` sql
31+ NOT ` happiness` AND ` anger` > 0
32+ ` ` `
33+
34+ ` ` ` sql
35+ NOT ` happiness` OR ~` ANGER` AND ` anger` IS NOT 0
36+ ` ` `
37+
38+ - [ ] Grouping with parenthesis
39+
40+ ` ` ` sql
41+ SELECT *
42+ FROM hats
43+ WHERE
44+ (1 != 2 OR 3 != 4) AND ( 3 == 3 )
45+ ` ` `
46+
47+ ` ` ` sql
48+ SELECT *
49+ FROM hats
50+ WHERE
51+ hat OR (shirt AND (shoes OR wig) AND pants)
52+ ` ` `
3153
3254- [ ] Remove ` modifier` key from all parts of AST and standardize as ` conditions`
3355
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ expression_concat
5656 }
5757
5858expression_wrapped
59- = sym_popen o n :( expression_unary / expression_node / expression_value ) o sym_pclose
59+ = sym_popen n :( expression ) o sym_pclose
6060 { return n; }
6161
6262expression_value
@@ -77,7 +77,7 @@ expression_unary
7777 ' format' : ' unary' ,
7878 ' variant' : ' operation' ,
7979 ' expression' : e,
80- ' operator' : o
80+ ' operator' : _ . key (o)
8181 };
8282 }
8383
You can’t perform that action at this time.
0 commit comments