@@ -65,14 +65,22 @@ this(immutable LexPosition pos, AST fun, AST[] args...) { super(pos); this.fun=fun; this.args=args.dup; } mixin SimpleClass; } + +/// +class Parameter +{ + string name; + string[] layers; + mixin SimpleClass; +} /// class FunLiteral : AST { - string[] params; - AST funbody; + Parameter[] params; + AST funbody; mixin SimpleClass; } /// Handy Generator for AST nodes. To use this, mixin EasyAst; @@ -85,10 +93,12 @@ { T genEast(P...)(P ps) { return new T(LexPosition.dummy, ps); } } alias genEast!StrLiteral strl; /// alias genEast!IntLiteral intl; /// - auto fun(string[] xs, AST ps) { return genEast!FunLiteral(xs,ps); } /// + auto fun(string[] xs, AST ps) { + return genEast!FunLiteral(array(map!((string x){return new Parameter(x,[]);})(xs)),ps); } + auto funp(Parameter[] xs, AST ps) { return genEast!FunLiteral(xs,ps); } /// alias genEast!VarExpression var; /// alias genEast!LayeredExpression lay; /// alias genEast!LetExpression let; /// alias genEast!FuncallExpression call; /// }