@@ -12,16 +12,17 @@ /// abstract class AST { LexPosition pos; + mixin SimpleConstructor; - mixin SimplePatternMatch; } /// class Int : AST { BigInt data; + mixin SimpleClass; this(LexPosition pos, int n) {super(pos); data = n;} this(LexPosition pos, long n) {super(pos); data = n;} this(LexPosition pos, BigInt n) {super(pos); data = n;} @@ -31,15 +32,17 @@ /// class Str : AST { string data; + mixin SimpleClass; } /// class Var : AST { string name; + mixin SimpleClass; } /// @@ -46,8 +49,9 @@ class Lay : AST { Layer layer; AST expr; + mixin SimpleClass; } /// @@ -56,26 +60,28 @@ string name; Layer layer; AST init; AST expr; + mixin SimpleClass; } /// class App : AST { AST fun; - AST[] args; - this(LexPosition pos, AST fun, AST[] args...) - { super(pos); this.fun=fun; this.args=args.dup; } + AST[] args; + mixin SimpleClass; + this(LexPosition pos, AST fun, AST[] args...) { super(pos); this.fun=fun; this.args=args.dup; } } /// class Parameter { string name; Layer[] layers; + mixin SimpleClass; } /// @@ -82,8 +88,9 @@ class Fun : AST { Parameter[] params; AST funbody; + mixin SimpleClass; } /// Handy Generator for AST nodes. To use this, mixin EasyAst;