@@ -44,8 +44,14 @@ mixin SimpleConstructor; alias data call; override string toString() const { return sprintf!"(function:%s:%s)"(data.ptr,data.funcptr); } } + +class UndValue : Value +{ + mixin SimpleClass; + override string toString() const { return ""; } +} /// Layer ID alias string Layer; @@ -69,13 +75,16 @@ } Value get(string i, Layer lay, in LexPosition pos=null) { - if( i in data ) + if( i in data ) { + if( lay !in data[i] ) + throw genex!RuntimeException(pos, sprintf!"variable %s is not set in layer %s"(i,lay)); return data[i][lay]; + } if( prototype is null ) throw new RuntimeException(pos, sprintf!"variable %s not found"(i)); - return prototype.get(i, lay); + return prototype.get(i, lay, pos); } private: Table prototype;