diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parse.y | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/parse.y b/src/parse.y index 760cb114a..73508b046 100644 --- a/src/parse.y +++ b/src/parse.y @@ -296,17 +296,19 @@ columnname(A) ::= nm(A) typetoken(Y). {sqlite3AddColumn(pParse,A,Y);} // %token_class id ID|INDEXED. - // And "ids" is an identifer-or-string. // %token_class ids ID|STRING. +// An identifier or a join-keyword +// +%token_class idj ID|INDEXED|JOIN_KW. + // The name of a column or table can be any of the following: // %type nm {Token} -nm(A) ::= id(A). +nm(A) ::= idj(A). nm(A) ::= STRING(A). -nm(A) ::= JOIN_KW(A). // A typetoken is really zero or more tokens that form a type name such // as can be found after the column name in a CREATE TABLE statement. @@ -1084,8 +1086,7 @@ idlist(A) ::= nm(Y). expr(A) ::= term(A). expr(A) ::= LP expr(X) RP. {A = X;} -expr(A) ::= id(X). {A=tokenExpr(pParse,TK_ID,X); /*A-overwrites-X*/} -expr(A) ::= JOIN_KW(X). {A=tokenExpr(pParse,TK_ID,X); /*A-overwrites-X*/} +expr(A) ::= idj(X). {A=tokenExpr(pParse,TK_ID,X); /*A-overwrites-X*/} expr(A) ::= nm(X) DOT nm(Y). { Expr *temp1 = tokenExpr(pParse,TK_ID,X); Expr *temp2 = tokenExpr(pParse,TK_ID,Y); @@ -1138,19 +1139,19 @@ expr(A) ::= CAST LP expr(E) AS typetoken(T) RP. { %endif SQLITE_OMIT_CAST -expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP. { +expr(A) ::= idj(X) LP distinct(D) exprlist(Y) RP. { A = sqlite3ExprFunction(pParse, Y, &X, D); } -expr(A) ::= id(X) LP STAR RP. { +expr(A) ::= idj(X) LP STAR RP. { A = sqlite3ExprFunction(pParse, 0, &X, 0); } %ifndef SQLITE_OMIT_WINDOWFUNC -expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP filter_over(Z). { +expr(A) ::= idj(X) LP distinct(D) exprlist(Y) RP filter_over(Z). { A = sqlite3ExprFunction(pParse, Y, &X, D); sqlite3WindowAttach(pParse, A, Z); } -expr(A) ::= id(X) LP STAR RP filter_over(Z). { +expr(A) ::= idj(X) LP STAR RP filter_over(Z). { A = sqlite3ExprFunction(pParse, 0, &X, 0); sqlite3WindowAttach(pParse, A, Z); } |