Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
dbf54764
Commit
dbf54764
authored
21 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
* Resolve an ambiguity between ifs and attribute selection, e.g., `if
b then x else y.z'.
parent
86b7efbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libexpr/parser.y
+7
-3
7 additions, 3 deletions
src/libexpr/parser.y
with
7 additions
and
3 deletions
src/libexpr/parser.y
+
7
−
3
View file @
dbf54764
...
@@ -32,7 +32,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, void * data, char * s)
...
@@ -32,7 +32,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, void * data, char * s)
ATermList ts;
ATermList ts;
}
}
%type <t> start expr expr_function expr_assert expr_op
%type <t> start expr expr_function expr_assert
expr_if
expr_op
%type <t> expr_app expr_select expr_simple bind inheritsrc formal
%type <t> expr_app expr_select expr_simple bind inheritsrc formal
%type <ts> binds ids expr_list formals
%type <ts> binds ids expr_list formals
%token <t> ID INT STR PATH URI
%token <t> ID INT STR PATH URI
...
@@ -60,6 +60,12 @@ expr_function
...
@@ -60,6 +60,12 @@ expr_function
expr_assert
expr_assert
: ASSERT expr ';' expr_assert
: ASSERT expr ';' expr_assert
{ $$ = ATmake("Assert(<term>, <term>)", $2, $4); }
{ $$ = ATmake("Assert(<term>, <term>)", $2, $4); }
| expr_if
;
expr_if
: IF expr THEN expr ELSE expr
{ $$ = ATmake("If(<term>, <term>, <term>)", $2, $4, $6); }
| expr_op
| expr_op
;
;
...
@@ -102,8 +108,6 @@ expr_simple
...
@@ -102,8 +108,6 @@ expr_simple
| '{' binds '}'
| '{' binds '}'
{ $$ = fixAttrs(0, $2); }
{ $$ = fixAttrs(0, $2); }
| '[' expr_list ']' { $$ = ATmake("List(<term>)", $2); }
| '[' expr_list ']' { $$ = ATmake("List(<term>)", $2); }
| IF expr THEN expr ELSE expr
{ $$ = ATmake("If(<term>, <term>, <term>)", $2, $4, $6); }
;
;
binds
binds
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment