aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_ast.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/MoonP/moon_ast.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h
index e2f54de..6b738d4 100644
--- a/src/MoonP/moon_ast.h
+++ b/src/MoonP/moon_ast.h
@@ -223,19 +223,20 @@ AST_END(Return)
223 223
224class existential_op_t; 224class existential_op_t;
225class Assign_t; 225class Assign_t;
226class Body_t; 226class Block_t;
227class Statement_t;
227 228
228AST_NODE(With) 229AST_NODE(With)
229 ast_ptr<false, existential_op_t> eop; 230 ast_ptr<false, existential_op_t> eop;
230 ast_ptr<true, ExpList_t> valueList; 231 ast_ptr<true, ExpList_t> valueList;
231 ast_ptr<false, Assign_t> assigns; 232 ast_ptr<false, Assign_t> assigns;
232 ast_ptr<true, Body_t> body; 233 ast_sel<true, Block_t, Statement_t> body;
233 AST_MEMBER(With, &eop, &valueList, &assigns, &body) 234 AST_MEMBER(With, &eop, &valueList, &assigns, &body)
234AST_END(With) 235AST_END(With)
235 236
236AST_NODE(SwitchCase) 237AST_NODE(SwitchCase)
237 ast_ptr<true, ExpList_t> valueList; 238 ast_ptr<true, ExpList_t> valueList;
238 ast_ptr<true, Body_t> body; 239 ast_sel<true, Block_t, Statement_t> body;
239 AST_MEMBER(SwitchCase, &valueList, &body) 240 AST_MEMBER(SwitchCase, &valueList, &body)
240AST_END(SwitchCase) 241AST_END(SwitchCase)
241 242
@@ -243,7 +244,7 @@ AST_NODE(Switch)
243 ast_ptr<true, Exp_t> target; 244 ast_ptr<true, Exp_t> target;
244 ast_ptr<true, Seperator_t> sep; 245 ast_ptr<true, Seperator_t> sep;
245 ast_list<true, SwitchCase_t> branches; 246 ast_list<true, SwitchCase_t> branches;
246 ast_ptr<false, Body_t> lastBranch; 247 ast_sel<false, Block_t, Statement_t> lastBranch;
247 AST_MEMBER(Switch, &target, &sep, &branches, &lastBranch) 248 AST_MEMBER(Switch, &target, &sep, &branches, &lastBranch)
248AST_END(Switch) 249AST_END(Switch)
249 250
@@ -255,22 +256,24 @@ AST_END(IfCond)
255 256
256AST_NODE(If) 257AST_NODE(If)
257 ast_ptr<true, Seperator_t> sep; 258 ast_ptr<true, Seperator_t> sep;
258 ast_sel_list<true, IfCond_t, Body_t> nodes; 259 ast_sel_list<true, IfCond_t, Block_t, Statement_t> nodes;
259 AST_MEMBER(If, &sep, &nodes) 260 AST_MEMBER(If, &sep, &nodes)
260AST_END(If) 261AST_END(If)
261 262
262AST_NODE(Unless) 263AST_NODE(Unless)
263 ast_ptr<true, Seperator_t> sep; 264 ast_ptr<true, Seperator_t> sep;
264 ast_sel_list<true, IfCond_t, Body_t> nodes; 265 ast_sel_list<true, IfCond_t, Block_t, Statement_t> nodes;
265 AST_MEMBER(Unless, &sep, &nodes) 266 AST_MEMBER(Unless, &sep, &nodes)
266AST_END(Unless) 267AST_END(Unless)
267 268
268AST_NODE(While) 269AST_NODE(While)
269 ast_ptr<true, Exp_t> condition; 270 ast_ptr<true, Exp_t> condition;
270 ast_ptr<true, Body_t> body; 271 ast_sel<true, Block_t, Statement_t> body;
271 AST_MEMBER(While, &condition, &body) 272 AST_MEMBER(While, &condition, &body)
272AST_END(While) 273AST_END(While)
273 274
275class Body_t;
276
274AST_NODE(Repeat) 277AST_NODE(Repeat)
275 ast_ptr<true, Body_t> body; 278 ast_ptr<true, Body_t> body;
276 ast_ptr<true, Exp_t> condition; 279 ast_ptr<true, Exp_t> condition;
@@ -287,7 +290,7 @@ AST_NODE(For)
287 ast_ptr<true, Exp_t> startValue; 290 ast_ptr<true, Exp_t> startValue;
288 ast_ptr<true, Exp_t> stopValue; 291 ast_ptr<true, Exp_t> stopValue;
289 ast_ptr<false, for_step_value_t> stepValue; 292 ast_ptr<false, for_step_value_t> stepValue;
290 ast_ptr<true, Body_t> body; 293 ast_sel<true, Block_t, Statement_t> body;
291 AST_MEMBER(For, &varName, &startValue, &stopValue, &stepValue, &body) 294 AST_MEMBER(For, &varName, &startValue, &stopValue, &stepValue, &body)
292AST_END(For) 295AST_END(For)
293 296
@@ -297,7 +300,7 @@ class star_exp_t;
297AST_NODE(ForEach) 300AST_NODE(ForEach)
298 ast_ptr<true, AssignableNameList_t> nameList; 301 ast_ptr<true, AssignableNameList_t> nameList;
299 ast_sel<true, star_exp_t, ExpList_t> loopValue; 302 ast_sel<true, star_exp_t, ExpList_t> loopValue;
300 ast_ptr<true, Body_t> body; 303 ast_sel<true, Block_t, Statement_t> body;
301 AST_MEMBER(ForEach, &nameList, &loopValue, &body) 304 AST_MEMBER(ForEach, &nameList, &loopValue, &body)
302AST_END(ForEach) 305AST_END(ForEach)
303 306