diff options
author | drh <drh@noemail.net> | 2017-12-24 00:18:47 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2017-12-24 00:18:47 +0000 |
commit | 1be266ba089bf463f1b0a5ea2839b7a1341d91ab (patch) | |
tree | 5dce4dc6834328c050928c7046a813d9472f4f07 /src/expr.c | |
parent | 88a921ce602c7d940a0ba4ed3eeeef31a4ce1455 (diff) | |
download | sqlite-1be266ba089bf463f1b0a5ea2839b7a1341d91ab.tar.gz sqlite-1be266ba089bf463f1b0a5ea2839b7a1341d91ab.zip |
Remove the ExprSpan object. Instead, keep track of the test of subphrases in
the parse using the "scanpt" non-terminal.
FossilOrigin-Name: 3eab7bdc44e0878b83dc86f27058a40c2ffafeacadc566f03693f6dc7e40a504
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index 524e53934..129c1299b 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1654,17 +1654,20 @@ void sqlite3ExprListSetName( void sqlite3ExprListSetSpan( Parse *pParse, /* Parsing context */ ExprList *pList, /* List to which to add the span. */ - ExprSpan *pSpan /* The span to be added */ + const char *zStart, /* Start of the span */ + const char *zEnd /* End of the span */ ){ sqlite3 *db = pParse->db; assert( pList!=0 || db->mallocFailed!=0 ); if( pList ){ struct ExprList_item *pItem = &pList->a[pList->nExpr-1]; + int n; assert( pList->nExpr>0 ); - assert( db->mallocFailed || pItem->pExpr==pSpan->pExpr ); sqlite3DbFree(db, pItem->zSpan); - pItem->zSpan = sqlite3DbStrNDup(db, (char*)pSpan->zStart, - (int)(pSpan->zEnd - pSpan->zStart)); + while( sqlite3Isspace(zStart[0]) ) zStart++; + n = (int)(zEnd - zStart); + while( n>0 && sqlite3Isspace(zStart[n-1]) ) n--; + pItem->zSpan = sqlite3DbStrNDup(db, zStart, n); } } |