aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2024-08-09 02:55:56 +0800
committerLi Jin <dragon-fly@qq.com>2024-08-09 02:55:56 +0800
commitb6c86d19d74ac90a2450cf979a92187e691ea5fa (patch)
tree6073623a0cca27aa64c68f0c554116e7475e0531 /spec
parent94edfbc8c7d62d700dfb59334a0ed3beedd49493 (diff)
downloadyuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.tar.gz
yuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.tar.bz2
yuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.zip
add yue.is_ast().
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/macro.yue8
-rw-r--r--spec/outputs/macro.lua6
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue
index a2e1046..3d4fb10 100644
--- a/spec/inputs/macro.yue
+++ b/spec/inputs/macro.yue
@@ -38,6 +38,14 @@ print $WindowFlag(
38 NoScrollbar 38 NoScrollbar
39) 39)
40 40
41macro NumAndStr = (num, str) ->
42 import "yue"
43 unless yue.is_ast("Num", "123")
44 error "unmatched tokens got"
45 "[#{num}, #{str}]"
46
47print $NumAndStr 123, 'xyz'
48
41$asserts item == nil 49$asserts item == nil
42 50
43$myconfig false 51$myconfig false
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua
index 953c260..4492827 100644
--- a/spec/outputs/macro.lua
+++ b/spec/outputs/macro.lua
@@ -7,6 +7,10 @@ print({
7 "NoMove", 7 "NoMove",
8 "NoScrollbar" 8 "NoScrollbar"
9}) 9})
10print({
11 123,
12 'xyz'
13})
10do 14do
11 assert(item == nil) 15 assert(item == nil)
12end 16end
@@ -294,7 +298,7 @@ print((setmetatable({
294 return 998 298 return 998
295 end 299 end
296})) 300}))
297print("current line: " .. tostring(301)) 301print("current line: " .. tostring(309))
298do 302do
299-- TODO 303-- TODO
300end 304end