Commit 17b7c076 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Use 'not' instead of '!' for boolean not operation

This makes it consistent with the 'and' and 'or' operators
parent 618908db
......@@ -145,8 +145,8 @@ logexpect l1 -d 1 -g vxid -q "RespStatus == 404 or RespStatus ~ '^200$'" {
expect * = End
} -run
# Test boolean !
logexpect l1 -d 1 -g vxid -q "RespStatus == 404 or !RespStatus ~ '^404$'" {
# Test boolean not
logexpect l1 -d 1 -g vxid -q "RespStatus == 404 or not RespStatus ~ '^404$'" {
expect 0 * Begin req
expect * = ReqEnd
expect * = End
......
......@@ -60,9 +60,10 @@ tokens = {
# Boolean operators
"T_AND": "and",
"T_OR": "or",
"T_NOT": "not",
# Miscellaneous
None: "<>~![]{}()",
None: "<>~[]{}()",
# These have handwritten recognizers
"VAL": None,
......
......@@ -236,7 +236,7 @@ vslq_exec(const struct vex *vex, struct VSL_transaction * const ptrans[])
if (r <= 0)
return (r);
return (vslq_exec(vex->b, ptrans));
case '!':
case T_NOT:
AN(vex->a);
AZ(vex->b);
r = vslq_exec(vex->a, ptrans);
......
......@@ -304,7 +304,7 @@ vxp_expr_group(struct vxp *vxp, struct vex **pvex)
/*
* SYNTAX:
* expr_not:
* '!' expr_group
* 'not' expr_group
* expr_group
*/
......@@ -315,7 +315,7 @@ vxp_expr_not(struct vxp *vxp, struct vex **pvex)
AN(pvex);
AZ(*pvex);
if (vxp->t->tok == '!') {
if (vxp->t->tok == T_NOT) {
ALLOC_OBJ(*pvex, VEX_MAGIC);
AN(*pvex);
(*pvex)->tok = vxp->t->tok;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment