Skip to content

Commit 6bbcb3c

Browse files
authored
fix: #213 flinksql expression syntax (#215)
* fix: #213 use uid to replace SLASH_TEXT in dtFilePath rule * test: #213 flinksql syntax expression --------- Co-authored-by: liuyi <liuyi@dtstack.com>
1 parent 00b66cc commit 6bbcb3c

File tree

13 files changed

+5254
-5298
lines changed

13 files changed

+5254
-5298
lines changed

src/grammar/flinksql/FlinkSqlLexer.g4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,7 @@ REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+
583583
| DEC_DIGIT+ EXPONENT_NUM_PART;
584584
BIT_STRING: BIT_STRING_L;
585585
ID_LITERAL: ID_LITERAL_FRAG;
586-
SLASH_TEXT: SLASH_TEXT_FRAG;
587586

588-
fragment SLASH_TEXT_FRAG: [/\\] (~([/\\ ] | '(' | ')' | ';'))*;
589587
fragment JAR_FILE_PARTTARN: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`';
590588
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
591589
fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*;

src/grammar/flinksql/FlinkSqlParser.g4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ dtAddStatement
101101
;
102102

103103
dtFilePath
104-
: SLASH_TEXT+
104+
: (SLASH_SIGN? uid)+
105105
;
106106

107107
// Create statements
@@ -698,7 +698,6 @@ valueExpression
698698
| left=valueExpression operator=BIT_XOR_OP right=valueExpression #arithmeticBinary
699699
| left=valueExpression operator=BIT_OR_OP right=valueExpression #arithmeticBinary
700700
| left=valueExpression comparisonOperator right=valueExpression #comparison
701-
| left=valueExpression right=SLASH_TEXT #arithmeticBinaryAlternate
702701
;
703702

704703
primaryExpression

src/lib/flinksql/FlinkSqlLexer.interp

Lines changed: 1 addition & 5 deletions
Large diffs are not rendered by default.

src/lib/flinksql/FlinkSqlLexer.tokens

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ DIG_LITERAL=538
539539
REAL_LITERAL=539
540540
BIT_STRING=540
541541
ID_LITERAL=541
542-
SLASH_TEXT=542
543542
'ABS'=4
544543
'ALL'=5
545544
'ALLOCATE'=6

src/lib/flinksql/FlinkSqlLexer.ts

Lines changed: 2611 additions & 2622 deletions
Large diffs are not rendered by default.

src/lib/flinksql/FlinkSqlParser.interp

Lines changed: 1 addition & 3 deletions
Large diffs are not rendered by default.

src/lib/flinksql/FlinkSqlParser.tokens

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ DIG_LITERAL=538
539539
REAL_LITERAL=539
540540
BIT_STRING=540
541541
ID_LITERAL=541
542-
SLASH_TEXT=542
543542
'ABS'=4
544543
'ALL'=5
545544
'ALLOCATE'=6

0 commit comments

Comments
 (0)