about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-03-28T21·15+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-03-28T21·15+0000
commitac4d39f9db28743b6c1e9def7a61241a50b02335 (patch)
tree85311119f03b0d44c8a2fe861706924349b792f1 /src/libexpr/parser.y
parentf958bcdf1f9f66759a2512e4b7c0b0ba5647960a (diff)
* Added an operator `?' to test for attribute existence, e.g.,
  `attrs ? x' yields true iff `attrs' has an attribute named `x'.

Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index b1fe9e093145..cfcbc589f61c 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -44,6 +44,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, void * data, char * s)
 %nonassoc EQ NEQ
 %right UPDATE
 %left NEG
+%nonassoc '?'
 %nonassoc '~'
 
 %%
@@ -81,6 +82,7 @@ expr_op
   | expr_op IMPL expr_op { $$ = ATmake("OpImpl(<term>, <term>)", $1, $3); }
   | expr_op UPDATE expr_op { $$ = ATmake("OpUpdate(<term>, <term>)", $1, $3); }
   | expr_op '~' expr_op { $$ = ATmake("SubPath(<term>, <term>)", $1, $3); }
+  | expr_op '?' ID { $$ = ATmake("OpHasAttr(<term>, <term>)", $1, $3); }
   | expr_app
   ;