aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2024-10-31 16:29:10 +0800
committerLi Jin <dragon-fly@qq.com>2024-10-31 16:29:19 +0800
commit37c8f0a862a570af707809d530b3284c6ff9229c (patch)
tree78de6d4bdfacd30602823cf05b437dd506572247 /spec
parent3387abbfe072cbfe1ed1e7a3d71668603831591b (diff)
downloadyuescript-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.yue15
-rw-r--r--spec/outputs/macro.lua15
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
6import "macro_todo" as $ 6import "macro_todo" as $
7 7
8macro not_leak = -> "leak"
9do
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
8macro WindowFlag = $enum( 23macro 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 @@
1do
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
10end
11do
12 (leak)()
13end
1print("AlwaysAutoResize") 14print("AlwaysAutoResize")
2print({ 15print({
3 "NoNav", 16 "NoNav",
@@ -298,7 +311,7 @@ print((setmetatable({
298 return 998 311 return 998
299 end 312 end
300})) 313}))
301print("current line: " .. tostring(308)) 314print("current line: " .. tostring(323))
302do 315do
303-- TODO 316-- TODO
304end 317end