aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/MoonP/moon_ast.h')
-rw-r--r--src/MoonP/moon_ast.h25
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)
106AST_END(colon_import_name) 106AST_END(colon_import_name)
107 107
108class Exp_t; 108class Exp_t;
109class TableLit_t;
109 110
110AST_NODE(Import, "Import"_id) 111AST_LEAF(import_literal_inner, "import_literal_inner"_id)
112AST_END(import_literal_inner)
113
114AST_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)
118AST_END(ImportLiteral)
119
120AST_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)
124AST_END(ImportAs)
125
126AST_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)
131AST_END(ImportFrom)
132
133AST_NODE(Import, "Import"_id)
134 ast_sel<true, ImportAs_t, ImportFrom_t> content;
135 AST_MEMBER(Import, &content)
115AST_END(Import) 136AST_END(Import)
116 137
117AST_NODE(ExpListLow, "ExpListLow"_id) 138AST_NODE(ExpListLow, "ExpListLow"_id)