about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·52+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·52+0200
commit8e5fbf4d730b9fcf39eddf5539a206cf19d2cdce (patch)
tree281d7553329e1f7431cc667be20ca60f4558acb3 /src/libexpr/parser.y
parent4c5faad99408cdfc35a8b0923d1efdf288fd9990 (diff)
Show position info in attribute selection errors
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 021f8b0266bc..dbcffff9965c 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -361,9 +361,9 @@ expr_app
 
 expr_select
   : expr_simple '.' attrpath
-    { $$ = new ExprSelect($1, *$3, 0); }
+    { $$ = new ExprSelect(CUR_POS, $1, *$3, 0); }
   | expr_simple '.' attrpath OR_KW expr_select
-    { $$ = new ExprSelect($1, *$3, $5); }
+    { $$ = new ExprSelect(CUR_POS, $1, *$3, $5); }
   | /* Backwards compatibility: because Nixpkgs has a rarely used
        function named ‘or’, allow stuff like ‘map or [...]’. */
     expr_simple OR_KW
@@ -403,7 +403,7 @@ expr_simple
   /* Let expressions `let {..., body = ...}' are just desugared
      into `(rec {..., body = ...}).body'. */
   | LET '{' binds '}'
-    { $3->recursive = true; $$ = new ExprSelect($3, data->symbols.create("body")); }
+    { $3->recursive = true; $$ = new ExprSelect(noPos, $3, data->symbols.create("body")); }
   | REC '{' binds '}'
     { $3->recursive = true; $$ = $3; }
   | '{' binds '}'
@@ -458,7 +458,7 @@ binds
       foreach (AttrPath::iterator, i, *$6) {
           if ($$->attrs.find(i->symbol) != $$->attrs.end())
               dupAttr(i->symbol, makeCurPos(@6, data), $$->attrs[i->symbol].pos);
-          $$->attrs[i->symbol] = ExprAttrs::AttrDef(new ExprSelect($4, i->symbol), makeCurPos(@6, data));
+          $$->attrs[i->symbol] = ExprAttrs::AttrDef(new ExprSelect(CUR_POS, $4, i->symbol), makeCurPos(@6, data));
       }
     }
   | { $$ = new ExprAttrs; }