Commit dec8a963 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add tag presence "operator"

parent b0080ea4
...@@ -186,3 +186,10 @@ logexpect l1 -d 1 -g vxid -q "Resp*:x-test eq '123 321'" { ...@@ -186,3 +186,10 @@ logexpect l1 -d 1 -g vxid -q "Resp*:x-test eq '123 321'" {
expect * = ReqEnd expect * = ReqEnd
expect * = End expect * = End
} -run } -run
# Test tag presence (no operator)
logexpect l1 -d 1 -g vxid -q "RespStatus" {
expect 0 * Begin req
expect * = ReqEnd
expect * = End
} -run
...@@ -68,6 +68,9 @@ tokens = { ...@@ -68,6 +68,9 @@ tokens = {
# These have handwritten recognizers # These have handwritten recognizers
"VAL": None, "VAL": None,
"EOI": None, "EOI": None,
# Special
"T_TRUE": None,
} }
####################################################################### #######################################################################
......
...@@ -80,8 +80,6 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec) ...@@ -80,8 +80,6 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
AN(vex); AN(vex);
AN(rec); AN(rec);
rhs = vex->rhs;
AN(rhs);
b = VSL_CDATA(rec->ptr); b = VSL_CDATA(rec->ptr);
e = b + VSL_LEN(rec->ptr) - 1; e = b + VSL_LEN(rec->ptr) - 1;
...@@ -116,6 +114,13 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec) ...@@ -116,6 +114,13 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
return (0); return (0);
} }
if (vex->tok == T_TRUE)
/* Always true */
return (1);
rhs = vex->rhs;
CHECK_OBJ_NOTNULL(rhs, VEX_RHS_MAGIC);
/* Prepare */ /* Prepare */
switch (vex->tok) { switch (vex->tok) {
case T_EQ: /* == */ case T_EQ: /* == */
...@@ -201,7 +206,6 @@ vslq_test(const struct vex *vex, struct VSL_transaction * const ptrans[]) ...@@ -201,7 +206,6 @@ vslq_test(const struct vex *vex, struct VSL_transaction * const ptrans[])
CHECK_OBJ_NOTNULL(vex, VEX_MAGIC); CHECK_OBJ_NOTNULL(vex, VEX_MAGIC);
CHECK_OBJ_NOTNULL(vex->lhs, VEX_LHS_MAGIC); CHECK_OBJ_NOTNULL(vex->lhs, VEX_LHS_MAGIC);
AN(vex->lhs->tags); AN(vex->lhs->tags);
CHECK_OBJ_NOTNULL(vex->rhs, VEX_RHS_MAGIC);
for (t = ptrans[0]; t != NULL; t = *++ptrans) { for (t = ptrans[0]; t != NULL; t = *++ptrans) {
AZ(VSL_ResetCursor(t->c)); AZ(VSL_ResetCursor(t->c));
......
...@@ -241,6 +241,7 @@ vxp_expr_cmp(struct vxp *vxp, struct vex **pvex) ...@@ -241,6 +241,7 @@ vxp_expr_cmp(struct vxp *vxp, struct vex **pvex)
case T_AND: case T_AND:
case T_OR: case T_OR:
case ')': case ')':
(*pvex)->tok = T_TRUE;
return; return;
/* Valid operators */ /* Valid operators */
......
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