1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

* Added an operator `?' to test for attribute existence, e.g.,

`attrs ? x' yields true iff `attrs' has an attribute named `x'.
This commit is contained in:
Eelco Dolstra 2004-03-28 21:15:01 +00:00
parent f958bcdf1f
commit ac4d39f9db
2 changed files with 10 additions and 1 deletions

View file

@ -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
;