@@ -127,7 +127,7 @@ UNION return 'UNION'
127127[a-zA-Z_\u4e00 -\u9fa5 ][a-zA-Z0-9_\u4e00 -\u9fa5 ] * return ' IDENTIFIER'
128128\. return ' DOT'
129129['"][a-zA-Z_\u4e00 -\u9fa5 ][a-zA-Z0-9_\u4e00 -\u9fa5 ] * ["'] return ' QUOTED_IDENTIFIER'
130- [`] . + [`] return ' QUOTED_IDENTIFIER'
130+ ( [`] )(?:(?=( \\ ? )) \2 . ) *? \1 return ' QUOTED_IDENTIFIER'
131131
132132<<EOF>> return ' EOF'
133133. return ' INVALID'
@@ -285,8 +285,7 @@ selectExprAliasOpt
285285 ;
286286
287287string
288- : QUOTED_IDENTIFIER { $$ = { type: ' String' , value: $1 } }
289- | STRING { $$ = { type: ' String' , value: $1 } }
288+ : STRING { $$ = { type: ' String' , value: $1 } }
290289 ;
291290number
292291 : NUMERIC { $$ = { type: ' Number' , value: $1 } }
@@ -328,6 +327,14 @@ identifier_list
328327 : identifier { $$ = { type: ' IdentifierList' , value: [ $1 ] } }
329328 | identifier_list ',' identifier { $$ = $1 ; $1 .value .push ($3 ); }
330329 ;
330+ quoted_identifier
331+ : QUOTED_IDENTIFIER { $$ = { type: ' Identifier' , value: $1 } }
332+ | quoted_identifier DOT QUOTED_IDENTIFIER { $$ = $1 ; $1 .value += ' .' + $3 }
333+ ;
334+ quoted_identifier_list
335+ : quoted_identifier { $$ = { type: ' IdentifierList' , value: [ $1 ] } }
336+ | quoted_identifier_list ',' quoted_identifier { $$ = $1 ; $1 .value .push ($3 ); }
337+ ;
331338case_expr_opt
332339 : { $$ = null }
333340 | expr { $$ = $1 }
@@ -353,6 +360,7 @@ simple_expr_prefix
353360simple_expr
354361 : literal { $$ = $1 }
355362 | identifier { $$ = $1 }
363+ | quoted_identifier { $$ = $1 }
356364 | function_call { $$ = $1 }
357365 | simple_expr_prefix { $$ = $1 }
358366 | '(' expr_list ')' { $$ = { type: ' SimpleExprParentheses' , value: $2 } }
0 commit comments