Skip to content

Commit

Permalink
fix: #213 flinksql expression syntax (#215)
Browse files Browse the repository at this point in the history
* fix: #213 use uid to replace SLASH_TEXT in dtFilePath rule

* test: #213 flinksql syntax expression

---------

Co-authored-by: liuyi <[email protected]>
  • Loading branch information
liuxy0551 and liuyi authored Nov 23, 2023
1 parent 00b66cc commit 6bbcb3c
Show file tree
Hide file tree
Showing 13 changed files with 5,254 additions and 5,298 deletions.
2 changes: 0 additions & 2 deletions src/grammar/flinksql/FlinkSqlLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,7 @@ REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+
| DEC_DIGIT+ EXPONENT_NUM_PART;
BIT_STRING: BIT_STRING_L;
ID_LITERAL: ID_LITERAL_FRAG;
SLASH_TEXT: SLASH_TEXT_FRAG;

fragment SLASH_TEXT_FRAG: [/\\] (~([/\\ ] | '(' | ')' | ';'))*;
fragment JAR_FILE_PARTTARN: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`';
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*;
Expand Down
3 changes: 1 addition & 2 deletions src/grammar/flinksql/FlinkSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dtAddStatement
;

dtFilePath
: SLASH_TEXT+
: (SLASH_SIGN? uid)+
;

// Create statements
Expand Down Expand Up @@ -698,7 +698,6 @@ valueExpression
| left=valueExpression operator=BIT_XOR_OP right=valueExpression #arithmeticBinary
| left=valueExpression operator=BIT_OR_OP right=valueExpression #arithmeticBinary
| left=valueExpression comparisonOperator right=valueExpression #comparison
| left=valueExpression right=SLASH_TEXT #arithmeticBinaryAlternate
;

primaryExpression
Expand Down
6 changes: 1 addition & 5 deletions src/lib/flinksql/FlinkSqlLexer.interp

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/lib/flinksql/FlinkSqlLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ DIG_LITERAL=538
REAL_LITERAL=539
BIT_STRING=540
ID_LITERAL=541
SLASH_TEXT=542
'ABS'=4
'ALL'=5
'ALLOCATE'=6
Expand Down
5,233 changes: 2,611 additions & 2,622 deletions src/lib/flinksql/FlinkSqlLexer.ts

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/lib/flinksql/FlinkSqlParser.interp

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/lib/flinksql/FlinkSqlParser.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ DIG_LITERAL=538
REAL_LITERAL=539
BIT_STRING=540
ID_LITERAL=541
SLASH_TEXT=542
'ABS'=4
'ALL'=5
'ALLOCATE'=6
Expand Down
Loading

0 comments on commit 6bbcb3c

Please sign in to comment.