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 /src/MoonP/moon_parser.h | |
| 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.
Diffstat (limited to 'src/MoonP/moon_parser.h')
| -rw-r--r-- | src/MoonP/moon_parser.h | 13 |
1 files changed, 9 insertions, 4 deletions
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) |
