Diff
Not logged in

Differences From Artifact [eb7f695558db6c0f]:

To Artifact [2eb228662dba6e2d]:


18 { 18 { 19 } 19 } 20 20 21 class UndefinedValue : Value 21 class UndefinedValue : Value 22 { 22 { 23 mixin SimpleConstructor; 23 mixin SimpleConstructor; 24 mixin SimpleCompare; 24 mixin SimpleCompare; > 25 override string toString() const { return "(undefined)"; } 25 } 26 } 26 27 27 class IntValue : Value 28 class IntValue : Value 28 { 29 { 29 BigInt data; 30 BigInt data; 30 mixin SimpleConstructor; 31 mixin SimpleConstructor; 31 mixin SimpleCompare; 32 mixin SimpleCompare; > 33 override string toString() const { > 34 const(char)[] cs; data.toString((const(char)[] s){cs=s;}, null); > 35 return to!string(cs); > 36 } 32 } 37 } 33 38 34 class StrValue : Value 39 class StrValue : Value 35 { 40 { 36 string data; 41 string data; 37 mixin SimpleConstructor; 42 mixin SimpleConstructor; 38 mixin SimpleCompare; 43 mixin SimpleCompare; > 44 override string toString() const { return data; } 39 } 45 } 40 46 41 class FunValue : Value 47 class FunValue : Value 42 { 48 { 43 Value delegate(immutable LexPosition pos, Value[]) data; 49 Value delegate(immutable LexPosition pos, Value[]) data; 44 mixin SimpleConstructor; 50 mixin SimpleConstructor; 45 Value call(immutable LexPosition pos, Value[] args) { return data(pos,ar 51 Value call(immutable LexPosition pos, Value[] args) { return data(pos,ar > 52 override string toString() const { return sprintf!"(function:%s:%s)"(dat 46 } 53 } 47 import std.stdio; 54 import std.stdio; 48 class Context 55 class Context 49 { 56 { 50 Context parent; 57 Context parent; 51 Value[string] table; 58 Value[string] table; 52 this(Context parent = null) { this.parent = parent; } 59 this(Context parent = null) { this.parent = parent; }