Differences From Artifact [98d6a7a3304f7043]:
- File
polemy/ast.d
- 2010-11-24 13:22:04 - part of checkin [f9c31f3cd8] on branch trunk - Fixed the null dereference bug when directly wrote "case 1 when 2: 3" in REPL. It was due to null LexPosition in the AST. Now AST.pos !is null is an invariant of AST. (user: kinaba) [annotate]
To Artifact [8ec2df800d3eb579]:
- File
polemy/ast.d
- 2010-11-26 07:42:38 - part of checkin [f7e9e77316] on branch trunk - introduced "..." expression, and replaced the pattern match failure with this. (user: kinaba) [annotate]
89 class Fun : AST 89 class Fun : AST
90 { 90 {
91 Parameter[] params; /// 91 Parameter[] params; ///
92 AST funbody; /// 92 AST funbody; ///
93 93
94 mixin SimpleClass; 94 mixin SimpleClass;
95 } 95 }
> 96
> 97 /// AST node for deadend
> 98 class Die : AST
> 99 {
> 100 mixin SimpleClass;
> 101 }
96 102
97 /// List of AST Types 103 /// List of AST Types
98 104
99 alias TypeTuple!(Int,Str,Var,Lay,Let,App,Fun) ListOfASTTypes; | 105 alias TypeTuple!(Int,Str,Var,Lay,Let,App,Fun,Die) ListOfASTTypes;
100 106
101 /// Handy Generator for AST nodes. To use this, mixin EasyAst; 107 /// Handy Generator for AST nodes. To use this, mixin EasyAst;
102 108
103 /*mixin*/ 109 /*mixin*/
104 template EasyAST() 110 template EasyAST()
105 { 111 {
106 /// 112 ///
................................................................................................................................................................................
113 return genEast!Fun(array(map!((string x){return new Parameter(x, 119 return genEast!Fun(array(map!((string x){return new Parameter(x,
114 auto funp(Parameter[] xs, AST ps) { return genEast!Fun(xs,ps); } /// 120 auto funp(Parameter[] xs, AST ps) { return genEast!Fun(xs,ps); } ///
115 alias genEast!Var var; /// 121 alias genEast!Var var; ///
116 alias genEast!Lay lay; /// 122 alias genEast!Lay lay; ///
117 alias genEast!Let let; /// 123 alias genEast!Let let; ///
118 alias genEast!App call; /// 124 alias genEast!App call; ///
119 auto param(string name, string[] lay...) { return new Parameter(name, la 125 auto param(string name, string[] lay...) { return new Parameter(name, la
> 126 alias genEast!Die dieast; ///
120 } 127 }