1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-28 19:36:04 +03:00

Add support for the MATCH operator. (CVS 3231)

FossilOrigin-Name: 815b84d5273b42978edcee0d4afe7f91a7933f4e
This commit is contained in:
drh
2006-06-13 15:37:26 +00:00
parent 5dc1aaa9d1
commit 03bea70cd8
3 changed files with 11 additions and 9 deletions

View File

@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.202 2006/06/11 23:41:55 drh Exp $
** @(#) $Id: parse.y,v 1.203 2006/06/13 15:37:26 drh Exp $
*/
// All token codes are small integers with #defines that begin with "TK_"
@@ -198,7 +198,7 @@ id(A) ::= ID(X). {A = X;}
%left OR.
%left AND.
%right NOT.
%left IS LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
%left IS MATCH LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
%left GT LE LT GE.
%right ESCAPE.
%left BITAND BITOR LSHIFT RSHIFT.
@@ -690,6 +690,8 @@ expr(A) ::= expr(X) CONCAT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
%type likeop {struct LikeOp}
likeop(A) ::= LIKE_KW(X). {A.eOperator = X; A.not = 0;}
likeop(A) ::= NOT LIKE_KW(X). {A.eOperator = X; A.not = 1;}
likeop(A) ::= MATCH(X). {A.eOperator = X; A.not = 0;}
likeop(A) ::= NOT MATCH(X). {A.eOperator = X; A.not = 1;}
%type escape {Expr*}
%destructor escape {sqlite3ExprDelete($$);}
escape(X) ::= ESCAPE expr(A). [ESCAPE] {X = A;}