aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-05-16 09:45:04 +0800
committerLi Jin <dragon-fly@qq.com>2022-05-16 09:45:27 +0800
commita9fe6a5c4c17cf7e8305c1d614939ce510fb1103 (patch)
tree404509931668656356cce49493f10e27d1cc32e6 /spec/inputs
parentc4935826eea8df7a161b2b4ba9262dce66d9d366 (diff)
downloadyuescript-a9fe6a5c4c17cf7e8305c1d614939ce510fb1103.tar.gz
yuescript-a9fe6a5c4c17cf7e8305c1d614939ce510fb1103.tar.bz2
yuescript-a9fe6a5c4c17cf7e8305c1d614939ce510fb1103.zip
fix issue #97 by line decorator.
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/attrib.yue8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/inputs/attrib.yue b/spec/inputs/attrib.yue
index 7e9a42c..500ef0f 100644
--- a/spec/inputs/attrib.yue
+++ b/spec/inputs/attrib.yue
@@ -14,6 +14,14 @@ do
14 close f = with io.open "file.txt" 14 close f = with io.open "file.txt"
15 \write "Hello" 15 \write "Hello"
16 16
17do
18 const a = 1 if true
19 close b = (if x then 1) unless false
20 const c = (switch x
21 when "abc" then 998) if true
22 close d =
23 :value if a ?? b
24
17macro defer = (item)-> "close _ = #{item}" 25macro defer = (item)-> "close _ = #{item}"
18macro defer_f = (func)-> "close _ = setmetatable {},__close:#{func}" 26macro defer_f = (func)-> "close _ = setmetatable {},__close:#{func}"
19 27