Add a Boolean "not" operator.
Not wholly convinced this is a good idea, maybe "not" should be a builtin function instead? 'not (.a == .b)' vs. '.a == .b | not'
This commit is contained in:
1 parent
6e6ea50763
commit
da5d653de8
5 files changed
+16
-1
No files matched your search
@@ -36,6 +36,7 @@
|
||||
%token END "end"
|
||||
%token AND "and"
|
||||
%token OR "or"
|
||||
%token NOT "not"
|
||||
%right "//"
|
||||
%nonassoc '=' SETPIPE
|
||||
%nonassoc EQ
|
||||
@@ -111,6 +112,10 @@ Exp "and" Exp {
|
||||
$$ = gen_and($1, $3);
|
||||
} |
|
||||
|
||||
"not" Exp {
|
||||
$$ = gen_not($2);
|
||||
} |
|
||||
|
||||
Exp "//" Exp {
|
||||
$$ = gen_definedor($1, $3);
|
||||
} |
|
||||
|
||||
Reference in new issue
Block a user