diff options
Diffstat (limited to 'src/MoonP/moon_ast.h')
-rw-r--r-- | src/MoonP/moon_ast.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h index 8b80af3..f8d2099 100644 --- a/src/MoonP/moon_ast.h +++ b/src/MoonP/moon_ast.h | |||
@@ -106,12 +106,33 @@ AST_NODE(colon_import_name, "colon_import_name"_id) | |||
106 | AST_END(colon_import_name) | 106 | AST_END(colon_import_name) |
107 | 107 | ||
108 | class Exp_t; | 108 | class Exp_t; |
109 | class TableLit_t; | ||
109 | 110 | ||
110 | AST_NODE(Import, "Import"_id) | 111 | AST_LEAF(import_literal_inner, "import_literal_inner"_id) |
112 | AST_END(import_literal_inner) | ||
113 | |||
114 | AST_NODE(ImportLiteral, "ImportLiteral"_id) | ||
115 | ast_ptr<true, Seperator_t> sep; | ||
116 | ast_sel_list<true, import_literal_inner_t> inners; | ||
117 | AST_MEMBER(ImportLiteral, &sep, &inners) | ||
118 | AST_END(ImportLiteral) | ||
119 | |||
120 | AST_NODE(ImportAs, "ImportAs"_id) | ||
121 | ast_ptr<true, ImportLiteral_t> literal; | ||
122 | ast_sel<false, Variable_t, TableLit_t> target; | ||
123 | AST_MEMBER(ImportAs, &literal, &target) | ||
124 | AST_END(ImportAs) | ||
125 | |||
126 | AST_NODE(ImportFrom, "ImportFrom"_id) | ||
111 | ast_ptr<true, Seperator_t> sep; | 127 | ast_ptr<true, Seperator_t> sep; |
112 | ast_sel_list<true, colon_import_name_t, Variable_t> names; | 128 | ast_sel_list<true, colon_import_name_t, Variable_t> names; |
113 | ast_ptr<true, Exp_t> exp; | 129 | ast_ptr<true, Exp_t> exp; |
114 | AST_MEMBER(Import, &sep, &names, &exp) | 130 | AST_MEMBER(ImportFrom, &sep, &names, &exp) |
131 | AST_END(ImportFrom) | ||
132 | |||
133 | AST_NODE(Import, "Import"_id) | ||
134 | ast_sel<true, ImportAs_t, ImportFrom_t> content; | ||
135 | AST_MEMBER(Import, &content) | ||
115 | AST_END(Import) | 136 | AST_END(Import) |
116 | 137 | ||
117 | AST_NODE(ExpListLow, "ExpListLow"_id) | 138 | AST_NODE(ExpListLow, "ExpListLow"_id) |