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 /spec/inputs/macro.mp | |
| 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 'spec/inputs/macro.mp')
| -rw-r--r-- | spec/inputs/macro.mp | 5 |
1 files changed, 4 insertions, 1 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 | ||
