diff options
author | drh <drh@noemail.net> | 2008-01-23 12:52:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-01-23 12:52:40 +0000 |
commit | 01495b992158f6da5568bcc11e82d6844ffff4a8 (patch) | |
tree | 4317198de87b54f358a6515089518e65c364a860 /tool/lempar.c | |
parent | 7e8b848a60a305231cca0b8cfc7f08be5f0429bd (diff) | |
download | sqlite-01495b992158f6da5568bcc11e82d6844ffff4a8.tar.gz sqlite-01495b992158f6da5568bcc11e82d6844ffff4a8.zip |
Improvements to test coverage in the lemon-generated parser and in the
sqlite3_get_table() interface. (CVS 4745)
FossilOrigin-Name: 9f95d79daeb5e7f6fd62f3c896dae4d332121d1c
Diffstat (limited to 'tool/lempar.c')
-rw-r--r-- | tool/lempar.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tool/lempar.c b/tool/lempar.c index 68a998ac5..cca91ad25 100644 --- a/tool/lempar.c +++ b/tool/lempar.c @@ -349,9 +349,7 @@ static int yy_find_shift_action( if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ return yy_default[stateno]; } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } + assert( iLookAhead!=YYNOCODE ); i += iLookAhead; if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ if( iLookAhead>0 ){ @@ -402,21 +400,14 @@ static int yy_find_reduce_action( YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; - /* int stateno = pParser->yystack[pParser->yyidx].stateno; */ - - if( stateno>YY_REDUCE_MAX || - (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } + assert( stateno<=YY_REDUCE_MAX ); + i = yy_reduce_ofst[stateno]; + assert( i!=YY_REDUCE_USE_DFLT ); + assert( iLookAhead!=YYNOCODE ); i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } + assert( i>=0 && i<YY_SZ_ACTTAB ); + assert( yy_lookahead[i]==iLookAhead ); + return yy_action[i]; } /* |