diff options
author | Li Jin <dragon-fly@qq.com> | 2024-10-31 16:29:10 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-10-31 16:29:19 +0800 |
commit | 37c8f0a862a570af707809d530b3284c6ff9229c (patch) | |
tree | 78de6d4bdfacd30602823cf05b437dd506572247 /spec | |
parent | 3387abbfe072cbfe1ed1e7a3d71668603831591b (diff) | |
download | yuescript-37c8f0a862a570af707809d530b3284c6ff9229c.tar.gz yuescript-37c8f0a862a570af707809d530b3284c6ff9229c.tar.bz2 yuescript-37c8f0a862a570af707809d530b3284c6ff9229c.zip |
Fixed issue #175 and #177.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/macro.yue | 15 | ||||
-rw-r--r-- | spec/outputs/macro.lua | 15 |
2 files changed, 29 insertions, 1 deletions
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue index d5197da..5dafd84 100644 --- a/spec/inputs/macro.yue +++ b/spec/inputs/macro.yue | |||
@@ -5,6 +5,21 @@ import "macro_export" as { | |||
5 | 5 | ||
6 | import "macro_todo" as $ | 6 | import "macro_todo" as $ |
7 | 7 | ||
8 | macro not_leak = -> "leak" | ||
9 | do | ||
10 | macro x = -> 123 | ||
11 | print $x | ||
12 | do | ||
13 | macro x = -> math.pi * 2 | ||
14 | print $x | ||
15 | macro x = -> 456 | ||
16 | print $x | ||
17 | |||
18 | import "macro_todo" as $todo: $not_leak | ||
19 | $not_leak "todo in a do block" | ||
20 | |||
21 | $not_leak!! | ||
22 | |||
8 | macro WindowFlag = $enum( | 23 | macro WindowFlag = $enum( |
9 | NoNav | 24 | NoNav |
10 | NoDecoration | 25 | NoDecoration |
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua index 777f754..83c6a90 100644 --- a/spec/outputs/macro.lua +++ b/spec/outputs/macro.lua | |||
@@ -1,3 +1,16 @@ | |||
1 | do | ||
2 | print(123) | ||
3 | do | ||
4 | print(6.2831853071796) | ||
5 | end | ||
6 | print(456) | ||
7 | do | ||
8 | -- TODO: "todo in a do block" | ||
9 | end | ||
10 | end | ||
11 | do | ||
12 | (leak)() | ||
13 | end | ||
1 | print("AlwaysAutoResize") | 14 | print("AlwaysAutoResize") |
2 | print({ | 15 | print({ |
3 | "NoNav", | 16 | "NoNav", |
@@ -298,7 +311,7 @@ print((setmetatable({ | |||
298 | return 998 | 311 | return 998 |
299 | end | 312 | end |
300 | })) | 313 | })) |
301 | print("current line: " .. tostring(308)) | 314 | print("current line: " .. tostring(323)) |
302 | do | 315 | do |
303 | -- TODO | 316 | -- TODO |
304 | end | 317 | end |