Skip to content

Commit 393e291

Browse files
h3n4lclaude
andauthored
feat(cosmosdb): add comparison and bitwise shift operators (#42)
* feat(cosmosdb): add comparison and bitwise shift operators Add support for comparison operators (<, <=, >, >=) and bitwise shift operators (<<, >>, >>>) to the CosmosDB parser grammar. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix(cosmosdb): remove duplicate angle bracket tokens to resolve lexer conflicts Remove LA_BRACKET_SYMBOL and RA_BRACKET_SYMBOL tokens that were conflicting with LESS_THAN_OPERATOR and GREATER_THAN_OPERATOR. The angle bracket symbols are now properly defined as comparison operators. This fixes ANTLR warnings about unreachable token values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: add bitwise operators in where clause Signed-off-by: h3n4l <[email protected]> --------- Signed-off-by: h3n4l <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 1143ed2 commit 393e291

File tree

5 files changed

+362
-274
lines changed

5 files changed

+362
-274
lines changed

cosmosdb/CosmosDBLexer.g4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ BIT_OR_SYMBOL: '|';
7070
DOUBLE_BAR_SYMBOL: '||';
7171
BIT_XOR_SYMBOL: '^';
7272
EQUAL_SYMBOL: '=';
73+
LESS_THAN_OPERATOR: '<';
74+
LESS_THAN_EQUAL_OPERATOR: '<=';
75+
GREATER_THAN_OPERATOR: '>';
76+
GREATER_THAN_EQUAL_OPERATOR: '>=';
77+
LEFT_SHIFT_OPERATOR: '<<';
78+
RIGHT_SHIFT_OPERATOR: '>>';
79+
ZERO_FILL_RIGHT_SHIFT_OPERATOR: '>>>';
80+
7381

7482
/* Identifiers */
7583
IDENTIFIER: [a-z] [a-z_0-9]*;

cosmosdb/CosmosDBParser.g4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,15 @@ binary_operator:
9797
| BIT_XOR_SYMBOL
9898
| BIT_OR_SYMBOL
9999
| DOUBLE_BAR_SYMBOL
100-
| EQUAL_SYMBOL;
100+
| EQUAL_SYMBOL
101+
| LESS_THAN_OPERATOR
102+
| LESS_THAN_EQUAL_OPERATOR
103+
| GREATER_THAN_OPERATOR
104+
| GREATER_THAN_EQUAL_OPERATOR
105+
| LEFT_SHIFT_OPERATOR
106+
| RIGHT_SHIFT_OPERATOR
107+
| ZERO_FILL_RIGHT_SHIFT_OPERATOR
108+
;
101109

102110
unary_operator: BIT_NOT_SYMBOL | PLUS_SYMBOL | MINUS_SYMBOL;
103111

0 commit comments

Comments
 (0)