Skip to content

Commit 6d491c2

Browse files
Copilotmathiasrw
andauthored
Support @ symbol in column names with backticks and qualified syntax to fix #884 (#2194)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mathiasrw <[email protected]> Co-authored-by: Mathias Wulff <[email protected]>
1 parent 9416897 commit 6d491c2

File tree

3 files changed

+442
-353
lines changed

3 files changed

+442
-353
lines changed

src/alasqlparser.jison

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ SETS return 'SET'
269269
'WHILE' return 'WHILE'
270270
'WITH' return 'WITH'
271271
'WORK' return 'TRANSACTION' /* Is this keyword required? */
272+
272273
/* Issue #1173: Reject invalid identifiers like 6minAvgOpac (number followed by letters without space) */
273274
/* This rule must precede NUMBER to catch invalid patterns before they're tokenized as NUMBER + LITERAL */
274275
\d+[a-zA-Z_][a-zA-Z_0-9]* return 'INVALID'
@@ -297,7 +298,6 @@ SETS return 'SET'
297298
'!=' return 'NE'
298299
'(' return 'LPAR'
299300
')' return 'RPAR'
300-
'@' return 'AT'
301301
'{' return 'LCUR'
302302
'}' return 'RCUR'
303303

@@ -319,6 +319,7 @@ SETS return 'SET'
319319
'~' return 'TILDA'
320320

321321
[0-9]*[a-zA-Z_]+[a-zA-Z_0-9]* return 'LITERAL'
322+
'@' return 'AT'
322323
<<EOF>> return 'EOF'
323324
. return 'INVALID'
324325

@@ -1202,6 +1203,8 @@ Column
12021203
{ $$ = new yy.Column({columnid: $3, tableid: $1});}
12031204
| Literal DOT VALUE
12041205
{ $$ = new yy.Column({columnid: $3, tableid: $1});}
1206+
| Literal DOT AT Literal
1207+
{ $$ = new yy.Column({columnid: '@'+$4, tableid: $1});}
12051208
| Literal
12061209
{ $$ = new yy.Column({columnid: $1});}
12071210
;

0 commit comments

Comments
 (0)