File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -1552,7 +1552,12 @@ fn opt_name(p: &mut Parser<'_>) -> Option<CompletedMarker> {
15521552fn path_segment ( p : & mut Parser < ' _ > , kind : SyntaxKind ) {
15531553 let m = p. start ( ) ;
15541554 // TODO: does this need to be flagged?
1555- if current_operator ( p) . is_some ( ) {
1555+ // Might want to disallow operators in some paths.
1556+ // Like `create table +()` doesn't make sense.
1557+ if !p. at ( OPERATOR_KW ) && current_operator ( p) . is_some ( ) {
1558+ // check for operator kw so we can parse things like:
1559+ // create table operator();
1560+
15561561 // skip
15571562 } else if p. at_ts ( COL_LABEL_FIRST ) {
15581563 let m = p. start ( ) ;
Original file line number Diff line number Diff line change @@ -351,3 +351,7 @@ create table t (
351351 d int storage main,
352352 e int storage default
353353);
354+
355+ create table operator (
356+ x int
357+ );
Original file line number Diff line number Diff line change @@ -3379,4 +3379,30 @@ SOURCE_FILE
33793379 WHITESPACE " \n "
33803380 R_PAREN " )"
33813381 SEMICOLON " ;"
3382+ WHITESPACE " \n\n "
3383+ CREATE_TABLE
3384+ CREATE_KW " create"
3385+ WHITESPACE " "
3386+ TABLE_KW " table"
3387+ WHITESPACE " "
3388+ PATH
3389+ PATH_SEGMENT
3390+ NAME
3391+ OPERATOR_KW " operator"
3392+ WHITESPACE " "
3393+ TABLE_ARG_LIST
3394+ L_PAREN " ("
3395+ WHITESPACE " \n "
3396+ COLUMN
3397+ NAME
3398+ IDENT " x"
3399+ WHITESPACE " "
3400+ PATH_TYPE
3401+ PATH
3402+ PATH_SEGMENT
3403+ NAME_REF
3404+ INT_KW " int"
3405+ WHITESPACE " \n "
3406+ R_PAREN " )"
3407+ SEMICOLON " ;"
33823408 WHITESPACE " \n "
You can’t perform that action at this time.
0 commit comments