about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-05-06T16·46+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-05-06T16·46+0000
commit84ce7ac76feab6e9a5c074bd1b9550ae543d1db8 (patch)
tree6fe85234390d62dd3e712cf2169d0963e4e87af2 /src/libexpr/eval.cc
parentc82782f9a5190c7489fb8e9bd6876b247b0de0bf (diff)
* Store attribute positions in the AST and report duplicate attribute
  errors with position info.
* For all positions, use the position of the first character of the
  first token, rather than the last character of the first token plus
  one.

Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index b4f12c8a9c..cb124ab8ba 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -192,11 +192,6 @@ LocalNoInlineNoReturn(void throwAssertionError(const char * s, const Pos & pos))
     throw AssertionError(format(s) % pos);
 }
 
-LocalNoInline(void addErrorPrefix(Error & e, const char * s))
-{
-    e.addPrefix(s);
-}
-
 LocalNoInline(void addErrorPrefix(Error & e, const char * s, const string & s2))
 {
     e.addPrefix(format(s) % s2);
@@ -207,11 +202,6 @@ LocalNoInline(void addErrorPrefix(Error & e, const char * s, const Pos & pos))
     e.addPrefix(format(s) % pos);
 }
 
-LocalNoInline(void addErrorPrefix(Error & e, const char * s, const string & s2, const string & s3))
-{
-    e.addPrefix(format(s) % s2 % s3);
-}
-
 
 void mkString(Value & v, const char * s)
 {
@@ -426,7 +416,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
         foreach (Attrs::iterator, i, attrs) {
             Value & v2 = (*v.attrs)[i->first];
             mkCopy(v2, env2.values[displ]);
-            mkThunk(env2.values[displ++], env2, i->second);
+            mkThunk(env2.values[displ++], env2, i->second.first);
         }
 
         /* The inherited attributes, on the other hand, are
@@ -443,7 +433,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
     else {
         foreach (Attrs::iterator, i, attrs) {
             Value & v2 = (*v.attrs)[i->first];
-            mkThunk(v2, env, i->second);
+            mkThunk(v2, env, i->second.first);
         }
 
         foreach (list<VarRef>::iterator, i, inherited) {
@@ -466,7 +456,7 @@ void ExprLet::eval(EvalState & state, Env & env, Value & v)
     /* The recursive attributes are evaluated in the new
        environment. */
     foreach (ExprAttrs::Attrs::iterator, i, attrs->attrs)
-        mkThunk(env2.values[displ++], env2, i->second);
+        mkThunk(env2.values[displ++], env2, i->second.first);
 
     /* The inherited attributes, on the other hand, are evaluated in
        the original environment. */