Skip to content

Commit a671e74

Browse files
Copilotmathiasrw
andauthored
Make KEY a context-aware keyword to close #2227 (#2387)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mathiasrw <[email protected]> Co-authored-by: M. Wulff <[email protected]>
1 parent 95bbff8 commit a671e74

File tree

3 files changed

+730
-575
lines changed

3 files changed

+730
-575
lines changed

src/alasqlparser.jison

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ Literal
359359
}
360360
| BRALITERAL
361361
{ $$ = doubleq($1.substr(1,$1.length-2)); }
362+
| KEY
363+
{ $$ = $1.toLowerCase(); }
362364
| error NonReserved
363365
{ $$ = $2.toLowerCase() }
364366
;
@@ -2131,8 +2133,8 @@ UniqueKey
21312133
;
21322134

21332135
IndexKey
2134-
: INDEX Literal LPAR ColumnsList RPAR
2135-
| KEY Literal LPAR ColumnsList RPAR
2136+
: INDEX Literal LPAR ColsList RPAR
2137+
{ $$ = {type: 'INDEX', indexid: $2, columns: $4}; }
21362138
;
21372139
ColsList
21382140
: Literal

0 commit comments

Comments
 (0)