diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-05-16 09:45:04 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-05-16 09:45:27 +0800 |
| commit | a9fe6a5c4c17cf7e8305c1d614939ce510fb1103 (patch) | |
| tree | 404509931668656356cce49493f10e27d1cc32e6 /spec/inputs | |
| parent | c4935826eea8df7a161b2b4ba9262dce66d9d366 (diff) | |
| download | yuescript-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.yue | 8 |
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 | ||
| 17 | do | ||
| 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 | |||
| 17 | macro defer = (item)-> "close _ = #{item}" | 25 | macro defer = (item)-> "close _ = #{item}" |
| 18 | macro defer_f = (func)-> "close _ = setmetatable {},__close:#{func}" | 26 | macro defer_f = (func)-> "close _ = setmetatable {},__close:#{func}" |
| 19 | 27 | ||
