Index: src/parse.y ================================================================== --- src/parse.y +++ src/parse.y @@ -12,11 +12,11 @@ ** This file contains SQLite's grammar for SQL. Process this file ** using the lemon parser generator to generate C code that runs ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.235 2007/11/12 09:50:26 danielk1977 Exp $ +** @(#) $Id: parse.y,v 1.236 2007/11/17 22:23:28 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" %token_prefix TK_ @@ -647,11 +647,11 @@ Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &Y); Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &Z); Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); A = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); } -term(A) ::= INTEGER|FLOAT|BLOB(X). {A = sqlite3PExpr(pParse, @X, 0, 0, &X);} +term(A) ::= INTEGER|FLOAT|BLOB(X). {A = sqlite3PExpr(pParse, @X, 0, 0, &X);} term(A) ::= STRING(X). {A = sqlite3PExpr(pParse, @X, 0, 0, &X);} expr(A) ::= REGISTER(X). {A = sqlite3RegisterExpr(pParse, &X);} expr(A) ::= VARIABLE(X). { Token *pToken = &X; Expr *pExpr = A = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken); @@ -736,11 +736,15 @@ } expr(A) ::= expr(X) IS NOT NULL(E). { A = sqlite3PExpr(pParse, TK_NOTNULL, X, 0, 0); sqlite3ExprSpan(A,&X->span,&E); } -expr(A) ::= NOT|BITNOT(B) expr(X). { +expr(A) ::= NOT(B) expr(X). { + A = sqlite3PExpr(pParse, @B, X, 0, 0); + sqlite3ExprSpan(A,&B,&X->span); +} +expr(A) ::= BITNOT(B) expr(X). { A = sqlite3PExpr(pParse, @B, X, 0, 0); sqlite3ExprSpan(A,&B,&X->span); } expr(A) ::= MINUS(B) expr(X). [UMINUS] { A = sqlite3PExpr(pParse, TK_UMINUS, X, 0, 0);