Index: addopcodes.awk ================================================================== --- addopcodes.awk +++ addopcodes.awk @@ -21,12 +21,11 @@ printf "#define TK_%-29s %4d\n", "TO_REAL", max+5 printf "#define TK_%-29s %4d\n", "END_OF_FILE", max+6 printf "#define TK_%-29s %4d\n", "ILLEGAL", max+7 printf "#define TK_%-29s %4d\n", "SPACE", max+8 printf "#define TK_%-29s %4d\n", "UNCLOSED_STRING", max+9 - printf "#define TK_%-29s %4d\n", "COMMENT", max+10 - printf "#define TK_%-29s %4d\n", "FUNCTION", max+11 - printf "#define TK_%-29s %4d\n", "COLUMN", max+12 - printf "#define TK_%-29s %4d\n", "AGG_FUNCTION", max+13 - printf "#define TK_%-29s %4d\n", "AGG_COLUMN", max+14 - printf "#define TK_%-29s %4d\n", "CONST_FUNC", max+15 + printf "#define TK_%-29s %4d\n", "FUNCTION", max+10 + printf "#define TK_%-29s %4d\n", "COLUMN", max+11 + printf "#define TK_%-29s %4d\n", "AGG_FUNCTION", max+12 + printf "#define TK_%-29s %4d\n", "AGG_COLUMN", max+13 + printf "#define TK_%-29s %4d\n", "CONST_FUNC", max+14 } Index: src/alter.c ================================================================== --- src/alter.c +++ src/alter.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** -** $Id: alter.c,v 1.47 2008/07/28 19:34:53 drh Exp $ +** $Id: alter.c,v 1.48 2008/08/08 14:19:41 drh Exp $ */ #include "sqliteInt.h" #include /* @@ -72,11 +72,11 @@ ** and its length in 'len' (to be used next iteration of this loop). */ do { zCsr += len; len = sqlite3GetToken(zCsr, &token); - } while( token==TK_SPACE || token==TK_COMMENT ); + } while( token==TK_SPACE ); assert( len>0 ); } while( token!=TK_LP && token!=TK_USING ); zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", tname.z - zSql, zSql, zTableName, tname.z+tname.n); 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.248 2008/07/31 01:40:42 shane Exp $ +** @(#) $Id: parse.y,v 1.249 2008/08/08 14:19:41 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" %token_prefix TK_ @@ -89,18 +89,18 @@ // Input is a single SQL command input ::= cmdlist. cmdlist ::= cmdlist ecmd. cmdlist ::= ecmd. -cmdx ::= cmd. { sqlite3FinishCoding(pParse); } ecmd ::= SEMI. ecmd ::= explain cmdx SEMI. explain ::= . { sqlite3BeginParse(pParse, 0); } %ifndef SQLITE_OMIT_EXPLAIN explain ::= EXPLAIN. { sqlite3BeginParse(pParse, 1); } explain ::= EXPLAIN QUERY PLAN. { sqlite3BeginParse(pParse, 2); } %endif SQLITE_OMIT_EXPLAIN +cmdx ::= cmd. { sqlite3FinishCoding(pParse); } ///////////////////// Begin and end transactions. //////////////////////////// // cmd ::= BEGIN transtype(Y) trans_opt. {sqlite3BeginTransaction(pParse, Y);} @@ -311,11 +311,11 @@ tcons ::= CONSTRAINT nm. tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R). {sqlite3AddPrimaryKey(pParse,X,R,I,0);} tcons ::= UNIQUE LP idxlist(X) RP onconf(R). {sqlite3CreateIndex(pParse,0,0,0,X,R,0,0,0,0);} -tcons ::= CHECK LP expr(E) RP onconf. {sqlite3AddCheckConstraint(pParse,E);} +tcons ::= CHECK LP expr(E) RP. {sqlite3AddCheckConstraint(pParse,E);} tcons ::= FOREIGN KEY LP idxlist(FA) RP REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). { sqlite3CreateForeignKey(pParse, FA, &T, TA, R); sqlite3DeferForeignKey(pParse, D); } @@ -883,35 +883,33 @@ %type idxlist {ExprList*} %destructor idxlist {sqlite3ExprListDelete(pParse->db, $$);} %type idxlist_opt {ExprList*} %destructor idxlist_opt {sqlite3ExprListDelete(pParse->db, $$);} -%type idxitem {Token} idxlist_opt(A) ::= . {A = 0;} idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} -idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder(Z). { +idxlist(A) ::= idxlist(X) COMMA nm(Y) collate(C) sortorder(Z). { Expr *p = 0; if( C.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetColl(pParse, p, &C); } A = sqlite3ExprListAppend(pParse,X, p, &Y); sqlite3ExprListCheckLength(pParse, A, "index"); if( A ) A->a[A->nExpr-1].sortOrder = Z; } -idxlist(A) ::= idxitem(Y) collate(C) sortorder(Z). { +idxlist(A) ::= nm(Y) collate(C) sortorder(Z). { Expr *p = 0; if( C.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetColl(pParse, p, &C); } A = sqlite3ExprListAppend(pParse,0, p, &Y); sqlite3ExprListCheckLength(pParse, A, "index"); if( A ) A->a[A->nExpr-1].sortOrder = Z; } -idxitem(A) ::= nm(X). {A = X;} %type collate {Token} collate(C) ::= . {C.z = 0; C.n = 0;} collate(C) ::= COLLATE ids(X). {C = X;} Index: src/tokenize.c ================================================================== --- src/tokenize.c +++ src/tokenize.c @@ -13,11 +13,11 @@ ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.149 2008/08/07 13:05:36 drh Exp $ +** $Id: tokenize.c,v 1.150 2008/08/08 14:19:41 drh Exp $ */ #include "sqliteInt.h" #include #include @@ -129,11 +129,11 @@ return i; } case '-': { if( z[1]=='-' ){ for(i=2; (c=z[i])!=0 && c!='\n'; i++){} - *tokenType = TK_COMMENT; + *tokenType = TK_SPACE; return i; } *tokenType = TK_MINUS; return 1; } @@ -162,11 +162,11 @@ *tokenType = TK_SLASH; return 1; } for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} if( c ) i++; - *tokenType = TK_COMMENT; + *tokenType = TK_SPACE; return i; } case '%': { *tokenType = TK_REM; return 1; @@ -418,12 +418,11 @@ if( i>mxSqlLen ){ pParse->rc = SQLITE_TOOBIG; break; } switch( tokenType ){ - case TK_SPACE: - case TK_COMMENT: { + case TK_SPACE: { if( db->u1.isInterrupted ){ pParse->rc = SQLITE_INTERRUPT; sqlite3SetString(pzErrMsg, db, "interrupt"); goto abort_parse; }