diff options
author | Li Jin <dragon-fly@qq.com> | 2020-10-15 09:38:01 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-10-15 09:38:01 +0800 |
commit | 2a7256ea8cb8a292d8f395c13ed2462df4c084a0 (patch) | |
tree | 03600fe01a7b4fd6c49f80eb1e570503bdc5bee4 | |
parent | b4687f90305c24149a5d43d84bf64fa192dae8f8 (diff) | |
download | yuescript-2a7256ea8cb8a292d8f395c13ed2462df4c084a0.tar.gz yuescript-2a7256ea8cb8a292d8f395c13ed2462df4c084a0.tar.bz2 yuescript-2a7256ea8cb8a292d8f395c13ed2462df4c084a0.zip |
add support to import all macros from a module with symbol '$' in import-as statement.
fix import macro rename issue.
-rw-r--r-- | spec/inputs/macro.mp | 5 | ||||
-rw-r--r-- | spec/inputs/macro_export.mp | 2 | ||||
-rw-r--r-- | src/MoonP/moon_ast.h | 40 | ||||
-rw-r--r-- | src/MoonP/moon_compiler.cpp | 56 | ||||
-rw-r--r-- | src/MoonP/moon_parser.cpp | 53 | ||||
-rw-r--r-- | src/MoonP/moon_parser.h | 13 |
6 files changed, 110 insertions, 59 deletions
diff --git a/spec/inputs/macro.mp b/spec/inputs/macro.mp index c7ec79c..103df95 100644 --- a/spec/inputs/macro.mp +++ b/spec/inputs/macro.mp | |||
@@ -5,7 +5,10 @@ macro block init = -> | |||
5 | 5 | ||
6 | $init! | 6 | $init! |
7 | 7 | ||
8 | import "macro_export" as {$myconfig:$config, :$showMacro, :$asserts, :$assert} | 8 | import "macro_export" as { |
9 | $, -- import all macros | ||
10 | $config:$myconfig, -- rename macro $config to $myconfig | ||
11 | } | ||
9 | 12 | ||
10 | $asserts item == nil | 13 | $asserts item == nil |
11 | 14 | ||
diff --git a/spec/inputs/macro_export.mp b/spec/inputs/macro_export.mp index 759c6d1..7208b2a 100644 --- a/spec/inputs/macro_export.mp +++ b/spec/inputs/macro_export.mp | |||
@@ -11,7 +11,7 @@ export macro expr showMacro = (name,res)-> | |||
11 | print txt | 11 | print txt |
12 | txt" | 12 | txt" |
13 | else | 13 | else |
14 | "#{res}" | 14 | res |
15 | 15 | ||
16 | export macro block asserts = (cond)-> | 16 | export macro block asserts = (cond)-> |
17 | if debugMode | 17 | if debugMode |
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h index 90508a5..dfe70ea 100644 --- a/src/MoonP/moon_ast.h +++ b/src/MoonP/moon_ast.h | |||
@@ -35,7 +35,15 @@ public: \ | |||
35 | }; \ | 35 | }; \ |
36 | template<> constexpr int id<type##_t>() { return COUNTER_READ; } | 36 | template<> constexpr int id<type##_t>() { return COUNTER_READ; } |
37 | 37 | ||
38 | AST_LEAF(Num) | 38 | AST_LEAF(Decimal) |
39 | AST_END(Decimal) | ||
40 | |||
41 | AST_LEAF(Integer) | ||
42 | AST_END(Integer) | ||
43 | |||
44 | AST_NODE(Num) | ||
45 | ast_sel<true, Decimal_t, Integer_t> num; | ||
46 | AST_MEMBER(Num, &num) | ||
39 | AST_END(Num) | 47 | AST_END(Num) |
40 | 48 | ||
41 | AST_LEAF(Name) | 49 | AST_LEAF(Name) |
@@ -146,9 +154,29 @@ AST_NODE(ImportFrom) | |||
146 | AST_MEMBER(ImportFrom, &sep, &names, &exp) | 154 | AST_MEMBER(ImportFrom, &sep, &names, &exp) |
147 | AST_END(ImportFrom) | 155 | AST_END(ImportFrom) |
148 | 156 | ||
157 | class MacroName_t; | ||
158 | |||
159 | AST_NODE(macro_name_pair) | ||
160 | ast_ptr<true, MacroName_t> key; | ||
161 | ast_ptr<true, MacroName_t> value; | ||
162 | AST_MEMBER(macro_name_pair, &key, &value) | ||
163 | AST_END(macro_name_pair) | ||
164 | |||
165 | AST_LEAF(import_all_macro) | ||
166 | AST_END(import_all_macro) | ||
167 | |||
168 | class variable_pair_t; | ||
169 | class normal_pair_t; | ||
170 | |||
171 | AST_NODE(ImportTabLit) | ||
172 | ast_ptr<true, Seperator_t> sep; | ||
173 | ast_sel_list<false, variable_pair_t, normal_pair_t, MacroName_t, macro_name_pair_t, import_all_macro_t> items; | ||
174 | AST_MEMBER(ImportTabLit, &sep, &items) | ||
175 | AST_END(ImportTabLit) | ||
176 | |||
149 | AST_NODE(ImportAs) | 177 | AST_NODE(ImportAs) |
150 | ast_ptr<true, ImportLiteral_t> literal; | 178 | ast_ptr<true, ImportLiteral_t> literal; |
151 | ast_sel<false, Variable_t, TableLit_t> target; | 179 | ast_sel<false, Variable_t, ImportTabLit_t> target; |
152 | AST_MEMBER(ImportAs, &literal, &target) | 180 | AST_MEMBER(ImportAs, &literal, &target) |
153 | AST_END(ImportAs) | 181 | AST_END(ImportAs) |
154 | 182 | ||
@@ -515,15 +543,9 @@ AST_END(Value) | |||
515 | AST_LEAF(default_value) | 543 | AST_LEAF(default_value) |
516 | AST_END(default_value) | 544 | AST_END(default_value) |
517 | 545 | ||
518 | AST_NODE(macro_name_pair) | ||
519 | ast_ptr<true, MacroName_t> key; | ||
520 | ast_ptr<true, MacroName_t> value; | ||
521 | AST_MEMBER(macro_name_pair, &key, &value) | ||
522 | AST_END(macro_name_pair) | ||
523 | |||
524 | AST_NODE(TableLit) | 546 | AST_NODE(TableLit) |
525 | ast_ptr<true, Seperator_t> sep; | 547 | ast_ptr<true, Seperator_t> sep; |
526 | ast_sel_list<false, variable_pair_t, normal_pair_t, Exp_t, MacroName_t, macro_name_pair_t> values; | 548 | ast_sel_list<false, variable_pair_t, normal_pair_t, Exp_t> values; |
527 | AST_MEMBER(TableLit, &sep, &values) | 549 | AST_MEMBER(TableLit, &sep, &values) |
528 | AST_END(TableLit) | 550 | AST_END(TableLit) |
529 | 551 | ||
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index 6e7db2c..f5835db 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
@@ -53,7 +53,7 @@ inline std::string s(std::string_view sv) { | |||
53 | return std::string(sv); | 53 | return std::string(sv); |
54 | } | 54 | } |
55 | 55 | ||
56 | const std::string_view version = "0.4.16"sv; | 56 | const std::string_view version = "0.4.17"sv; |
57 | const std::string_view extension = "mp"sv; | 57 | const std::string_view extension = "mp"sv; |
58 | 58 | ||
59 | class MoonCompilerImpl { | 59 | class MoonCompilerImpl { |
@@ -4911,11 +4911,12 @@ private: | |||
4911 | auto name = moduleNameFrom(import->literal); | 4911 | auto name = moduleNameFrom(import->literal); |
4912 | import->target.set(toAst<Variable_t>(name, x)); | 4912 | import->target.set(toAst<Variable_t>(name, x)); |
4913 | } | 4913 | } |
4914 | if (auto tableLit = import->target.as<TableLit_t>()) { | 4914 | if (auto tabLit = import->target.as<ImportTabLit_t>()) { |
4915 | auto newTab = x->new_ptr<TableLit_t>(); | 4915 | auto newTab = x->new_ptr<ImportTabLit_t>(); |
4916 | #ifndef MOONP_NO_MACRO | 4916 | #ifndef MOONP_NO_MACRO |
4917 | bool importAllMacro = false; | ||
4917 | std::list<std::pair<std::string,std::string>> macroPairs; | 4918 | std::list<std::pair<std::string,std::string>> macroPairs; |
4918 | for (auto item : tableLit->values.objects()) { | 4919 | for (auto item : tabLit->items.objects()) { |
4919 | switch (item->getId()) { | 4920 | switch (item->getId()) { |
4920 | case id<MacroName_t>(): { | 4921 | case id<MacroName_t>(): { |
4921 | auto macroName = static_cast<MacroName_t*>(item); | 4922 | auto macroName = static_cast<MacroName_t*>(item); |
@@ -4925,21 +4926,27 @@ private: | |||
4925 | } | 4926 | } |
4926 | case id<macro_name_pair_t>(): { | 4927 | case id<macro_name_pair_t>(): { |
4927 | auto pair = static_cast<macro_name_pair_t*>(item); | 4928 | auto pair = static_cast<macro_name_pair_t*>(item); |
4928 | macroPairs.emplace_back(_parser.toString(pair->value->name), _parser.toString(pair->key->name)); | 4929 | macroPairs.emplace_back(_parser.toString(pair->key->name), _parser.toString(pair->value->name)); |
4929 | break; | 4930 | break; |
4930 | } | 4931 | } |
4931 | default: | 4932 | case id<import_all_macro_t>(): |
4932 | newTab->values.push_back(item); | 4933 | if (importAllMacro) throw std::logic_error(_info.errorMessage(s("import all macro symbol duplicated"sv), item)); |
4934 | importAllMacro = true; | ||
4935 | break; | ||
4936 | case id<variable_pair_t>(): | ||
4937 | case id<normal_pair_t>(): | ||
4938 | newTab->items.push_back(item); | ||
4933 | break; | 4939 | break; |
4940 | default: assert(false); break; | ||
4934 | } | 4941 | } |
4935 | } | 4942 | } |
4936 | if (!macroPairs.empty()) { | 4943 | if (importAllMacro || !macroPairs.empty()) { |
4937 | auto moduleName = _parser.toString(import->literal); | 4944 | auto moduleName = _parser.toString(import->literal); |
4938 | Utils::replace(moduleName, "'"sv, ""sv); | 4945 | Utils::replace(moduleName, "'"sv, ""sv); |
4939 | Utils::replace(moduleName, "\""sv, ""sv); | 4946 | Utils::replace(moduleName, "\""sv, ""sv); |
4940 | Utils::trim(moduleName); | 4947 | Utils::trim(moduleName); |
4941 | pushCurrentModule(); // cur | 4948 | pushCurrentModule(); // cur |
4942 | int top = lua_gettop(L) - 1; | 4949 | int top = lua_gettop(L) - 1; // Lua state may be setup by pushCurrentModule() |
4943 | DEFER(lua_settop(L, top)); | 4950 | DEFER(lua_settop(L, top)); |
4944 | pushMoonp("find_modulepath"sv); // cur find_modulepath | 4951 | pushMoonp("find_modulepath"sv); // cur find_modulepath |
4945 | lua_pushlstring(L, moduleName.c_str(), moduleName.size()); // cur find_modulepath moduleName | 4952 | lua_pushlstring(L, moduleName.c_str(), moduleName.size()); // cur find_modulepath moduleName |
@@ -4977,27 +4984,38 @@ private: | |||
4977 | } | 4984 | } |
4978 | lua_pop(L, 1); // cur | 4985 | lua_pop(L, 1); // cur |
4979 | } | 4986 | } |
4980 | pushModuleTable(moduleFullName); // cur module | 4987 | pushModuleTable(moduleFullName); // cur mod |
4988 | if (importAllMacro) { | ||
4989 | lua_pushnil(L); // cur mod startKey | ||
4990 | while (lua_next(L, -2) != 0) { // cur mod key value | ||
4991 | lua_pushvalue(L, -2); // cur mod key value key | ||
4992 | lua_insert(L, -2); // cur mod key key value | ||
4993 | lua_rawset(L, -5); // cur[key] = value, cur mod key | ||
4994 | } | ||
4995 | } | ||
4981 | for (const auto& pair : macroPairs) { | 4996 | for (const auto& pair : macroPairs) { |
4982 | lua_getfield(L, -1, pair.first.c_str()); | 4997 | lua_getfield(L, -1, pair.first.c_str()); // mod[first], cur mod val |
4983 | lua_setfield(L, -3, pair.second.c_str()); | 4998 | lua_setfield(L, -3, pair.second.c_str()); // cur[second] = val, cur mod |
4984 | } | 4999 | } |
4985 | } | 5000 | } |
4986 | #else // MOONP_NO_MACRO | 5001 | #else // MOONP_NO_MACRO |
4987 | for (auto item : tableLit->values.objects()) { | 5002 | for (auto item : tabLit->items.objects()) { |
4988 | switch (item->getId()) { | 5003 | switch (item->getId()) { |
4989 | case id<MacroName_t>(): | 5004 | case id<MacroName_t>(): |
4990 | case id<macro_name_pair_t>(): { | 5005 | case id<macro_name_pair_t>(): |
5006 | case id<import_all_macro_t>(): { | ||
4991 | throw std::logic_error(_info.errorMessage("macro feature not supported"sv, item)); | 5007 | throw std::logic_error(_info.errorMessage("macro feature not supported"sv, item)); |
4992 | break; | 5008 | break; |
4993 | } | 5009 | } |
4994 | default: | 5010 | case id<variable_pair_t>(): |
4995 | newTab->values.push_back(item); | 5011 | case id<normal_pair_t>(): |
5012 | newTab->items.push_back(item); | ||
4996 | break; | 5013 | break; |
5014 | default: assert(false); break; | ||
4997 | } | 5015 | } |
4998 | } | 5016 | } |
4999 | #endif // MOONP_NO_MACRO | 5017 | #endif // MOONP_NO_MACRO |
5000 | if (newTab->values.empty()) { | 5018 | if (newTab->items.empty()) { |
5001 | out.push_back(Empty); | 5019 | out.push_back(Empty); |
5002 | return; | 5020 | return; |
5003 | } else { | 5021 | } else { |
@@ -5013,8 +5031,10 @@ private: | |||
5013 | chainValue->items.push_back(callable); | 5031 | chainValue->items.push_back(callable); |
5014 | value->item.set(chainValue); | 5032 | value->item.set(chainValue); |
5015 | } else { | 5033 | } else { |
5016 | auto tableLit = ast_to<TableLit_t>(target); | 5034 | auto tabLit = ast_to<ImportTabLit_t>(target); |
5017 | auto simpleValue = x->new_ptr<SimpleValue_t>(); | 5035 | auto simpleValue = x->new_ptr<SimpleValue_t>(); |
5036 | auto tableLit = x->new_ptr<TableLit_t>(); | ||
5037 | tableLit->values.dup(tabLit->items); | ||
5018 | simpleValue->value.set(tableLit); | 5038 | simpleValue->value.set(tableLit); |
5019 | value->item.set(simpleValue); | 5039 | value->item.set(simpleValue); |
5020 | } | 5040 | } |
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index 41db324..6485e46 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp | |||
@@ -51,19 +51,23 @@ MoonParser::MoonParser() { | |||
51 | EmptyLine = SpaceBreak; | 51 | EmptyLine = SpaceBreak; |
52 | AlphaNum = range('a', 'z') | range('A', 'Z') | range('0', '9') | '_'; | 52 | AlphaNum = range('a', 'z') | range('A', 'Z') | range('0', '9') | '_'; |
53 | Name = (range('a', 'z') | range('A', 'Z') | '_') >> *AlphaNum; | 53 | Name = (range('a', 'z') | range('A', 'Z') | '_') >> *AlphaNum; |
54 | Num = | 54 | Decimal = ( |
55 | ( | ||
56 | +range('0', '9') >> -('.' >> +range('0', '9')) | ||
57 | ) | ( | ||
58 | '.' >> +range('0', '9') | ||
59 | ) | ||
60 | ) >> -(set("eE") >> -expr('-') >> +range('0', '9')); | ||
61 | Integer = | ||
55 | ( | 62 | ( |
56 | "0x" >> | 63 | "0x" >> |
57 | +(range('0', '9') | range('a', 'f') | range('A', 'F')) >> | 64 | +(range('0', '9') | range('a', 'f') | range('A', 'F')) >> |
58 | -(-set("uU") >> set("lL") >> set("lL")) | 65 | -(-set("uU") >> set("lL") >> set("lL")) |
59 | ) | ( | 66 | ) | ( |
60 | +range('0', '9') >> -set("uU") >> set("lL") >> set("lL") | 67 | +range('0', '9') >> -set("uU") >> set("lL") >> set("lL") |
61 | ) | ( | ||
62 | ( | ||
63 | (+range('0', '9') >> -('.' >> +range('0', '9'))) | | ||
64 | ('.' >> +range('0', '9')) | ||
65 | ) >> -(set("eE") >> -expr('-') >> +range('0', '9')) | ||
66 | ); | 68 | ); |
69 | Num = Integer | Decimal; | ||
70 | |||
67 | Cut = false_(); | 71 | Cut = false_(); |
68 | Seperator = true_(); | 72 | Seperator = true_(); |
69 | 73 | ||
@@ -185,26 +189,28 @@ MoonParser::MoonParser() { | |||
185 | colon_import_name = sym('\\') >> Space >> Variable; | 189 | colon_import_name = sym('\\') >> Space >> Variable; |
186 | ImportName = colon_import_name | Space >> Variable; | 190 | ImportName = colon_import_name | Space >> Variable; |
187 | ImportNameList = Seperator >> *SpaceBreak >> ImportName >> *((+SpaceBreak | sym(',') >> *SpaceBreak) >> ImportName); | 191 | ImportNameList = Seperator >> *SpaceBreak >> ImportName >> *((+SpaceBreak | sym(',') >> *SpaceBreak) >> ImportName); |
192 | ImportFrom = ImportNameList >> *SpaceBreak >> key("from") >> Exp; | ||
188 | 193 | ||
189 | import_literal_inner = (range('a', 'z') | range('A', 'Z') | set("_-")) >> *(AlphaNum | '-'); | 194 | import_literal_inner = (range('a', 'z') | range('A', 'Z') | set("_-")) >> *(AlphaNum | '-'); |
190 | import_literal_chain = Seperator >> import_literal_inner >> *(expr('.') >> import_literal_inner); | 195 | import_literal_chain = Seperator >> import_literal_inner >> *(expr('.') >> import_literal_inner); |
191 | ImportLiteral = sym('\'') >> import_literal_chain >> symx('\'') | sym('"') >> import_literal_chain >> symx('"'); | 196 | ImportLiteral = sym('\'') >> import_literal_chain >> symx('\'') | sym('"') >> import_literal_chain >> symx('"'); |
192 | 197 | ||
193 | ImportFrom = ImportNameList >> *SpaceBreak >> key("from") >> Exp; | 198 | macro_name_pair = Space >> MacroName >> Space >> symx(':') >> Space >> MacroName; |
194 | 199 | import_all_macro = expr('$'); | |
195 | EnableMacroPair = pl::user(true_(), [](const item_t& item) { | 200 | ImportTabItem = variable_pair | normal_pair | sym(':') >> MacroName | macro_name_pair | Space >> import_all_macro; |
196 | State* st = reinterpret_cast<State*>(item.user_data); | 201 | ImportTabList = ImportTabItem >> *(sym(',') >> ImportTabItem); |
197 | st->macroPairEnabled = true; | 202 | ImportTabLine = ( |
198 | return true; | 203 | PushIndent >> (ImportTabList >> PopIndent | PopIndent) |
199 | }); | 204 | ) | Space; |
200 | 205 | import_tab_lines = SpaceBreak >> ImportTabLine >> *(-sym(',') >> SpaceBreak >> ImportTabLine) >> -sym(','); | |
201 | DiableMacroPair = pl::user(true_(), [](const item_t& item) { | 206 | ImportTabLit = |
202 | State* st = reinterpret_cast<State*>(item.user_data); | 207 | sym('{') >> Seperator >> |
203 | st->macroPairEnabled = false; | 208 | -ImportTabList >> |
204 | return true; | 209 | -sym(',') >> |
205 | }); | 210 | -import_tab_lines >> |
211 | White >> sym('}'); | ||
206 | 212 | ||
207 | ImportAs = ImportLiteral >> -(key("as") >> (Space >> Variable | EnableMacroPair >> ensure(TableLit, DiableMacroPair))); | 213 | ImportAs = ImportLiteral >> -(key("as") >> (Space >> Variable | ImportTabLit)); |
208 | 214 | ||
209 | Import = key("import") >> (ImportAs | ImportFrom); | 215 | Import = key("import") >> (ImportAs | ImportFrom); |
210 | 216 | ||
@@ -483,12 +489,7 @@ MoonParser::MoonParser() { | |||
483 | symx(':') >> | 489 | symx(':') >> |
484 | (Exp | TableBlock | +(SpaceBreak) >> Exp); | 490 | (Exp | TableBlock | +(SpaceBreak) >> Exp); |
485 | 491 | ||
486 | macro_name_pair = Space >> MacroName >> Space >> symx(':') >> Space >> MacroName; | 492 | KeyValue = variable_pair | normal_pair; |
487 | |||
488 | KeyValue = variable_pair | normal_pair | pl::user(sym(':') >> MacroName | macro_name_pair, [](const item_t& item) { | ||
489 | State* st = reinterpret_cast<State*>(item.user_data); | ||
490 | return st->macroPairEnabled; | ||
491 | }); | ||
492 | 493 | ||
493 | KeyValueList = KeyValue >> *(sym(',') >> KeyValue); | 494 | KeyValueList = KeyValue >> *(sym(',') >> KeyValue); |
494 | KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> Exp); | 495 | KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> Exp); |
diff --git a/src/MoonP/moon_parser.h b/src/MoonP/moon_parser.h index 6b7f224..bd62e86 100644 --- a/src/MoonP/moon_parser.h +++ b/src/MoonP/moon_parser.h | |||
@@ -75,7 +75,6 @@ protected: | |||
75 | State() { | 75 | State() { |
76 | indents.push(0); | 76 | indents.push(0); |
77 | } | 77 | } |
78 | bool macroPairEnabled = false; | ||
79 | bool exportDefault = false; | 78 | bool exportDefault = false; |
80 | int exportCount = 0; | 79 | int exportCount = 0; |
81 | int moduleFix = 0; | 80 | int moduleFix = 0; |
@@ -130,11 +129,13 @@ private: | |||
130 | rule ImportName; | 129 | rule ImportName; |
131 | rule ImportNameList; | 130 | rule ImportNameList; |
132 | rule import_literal_chain; | 131 | rule import_literal_chain; |
132 | rule ImportTabItem; | ||
133 | rule ImportTabList; | ||
134 | rule ImportTabLine; | ||
135 | rule import_tab_lines; | ||
133 | rule WithExp; | 136 | rule WithExp; |
134 | rule DisableDo; | 137 | rule DisableDo; |
135 | rule PopDo; | 138 | rule PopDo; |
136 | rule EnableMacroPair; | ||
137 | rule DiableMacroPair; | ||
138 | rule SwitchElse; | 139 | rule SwitchElse; |
139 | rule SwitchBlock; | 140 | rule SwitchBlock; |
140 | rule IfElseIf; | 141 | rule IfElseIf; |
@@ -182,6 +183,8 @@ private: | |||
182 | rule Line; | 183 | rule Line; |
183 | rule Shebang; | 184 | rule Shebang; |
184 | 185 | ||
186 | AST_RULE(Decimal) | ||
187 | AST_RULE(Integer) | ||
185 | AST_RULE(Num) | 188 | AST_RULE(Num) |
186 | AST_RULE(Name) | 189 | AST_RULE(Name) |
187 | AST_RULE(Variable) | 190 | AST_RULE(Variable) |
@@ -204,6 +207,9 @@ private: | |||
204 | AST_RULE(import_literal_inner) | 207 | AST_RULE(import_literal_inner) |
205 | AST_RULE(ImportLiteral) | 208 | AST_RULE(ImportLiteral) |
206 | AST_RULE(ImportFrom) | 209 | AST_RULE(ImportFrom) |
210 | AST_RULE(macro_name_pair) | ||
211 | AST_RULE(import_all_macro) | ||
212 | AST_RULE(ImportTabLit) | ||
207 | AST_RULE(ImportAs) | 213 | AST_RULE(ImportAs) |
208 | AST_RULE(Import) | 214 | AST_RULE(Import) |
209 | AST_RULE(Label) | 215 | AST_RULE(Label) |
@@ -275,7 +281,6 @@ private: | |||
275 | AST_RULE(Export) | 281 | AST_RULE(Export) |
276 | AST_RULE(variable_pair) | 282 | AST_RULE(variable_pair) |
277 | AST_RULE(normal_pair) | 283 | AST_RULE(normal_pair) |
278 | AST_RULE(macro_name_pair) | ||
279 | AST_RULE(FnArgDef) | 284 | AST_RULE(FnArgDef) |
280 | AST_RULE(FnArgDefList) | 285 | AST_RULE(FnArgDefList) |
281 | AST_RULE(outer_var_shadow) | 286 | AST_RULE(outer_var_shadow) |