Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
17b7c076
Commit
17b7c076
authored
Sep 25, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'not' instead of '!' for boolean not operation
This makes it consistent with the 'and' and 'or' operators
parent
618908db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
l00001.vtc
bin/varnishtest/tests/l00001.vtc
+2
-2
generate.py
lib/libvarnishapi/generate.py
+2
-1
vsl_query.c
lib/libvarnishapi/vsl_query.c
+1
-1
vxp_parse.c
lib/libvarnishapi/vxp_parse.c
+2
-2
No files found.
bin/varnishtest/tests/l00001.vtc
View file @
17b7c076
...
...
@@ -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
...
...
lib/libvarnishapi/generate.py
View file @
17b7c076
...
...
@@ -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
,
...
...
lib/libvarnishapi/vsl_query.c
View file @
17b7c076
...
...
@@ -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
);
...
...
lib/libvarnishapi/vxp_parse.c
View file @
17b7c076
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment