diff options
author | Li Jin <dragon-fly@qq.com> | 2024-08-09 02:55:56 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-08-09 02:55:56 +0800 |
commit | b6c86d19d74ac90a2450cf979a92187e691ea5fa (patch) | |
tree | 6073623a0cca27aa64c68f0c554116e7475e0531 /spec/inputs | |
parent | 94edfbc8c7d62d700dfb59334a0ed3beedd49493 (diff) | |
download | yuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.tar.gz yuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.tar.bz2 yuescript-b6c86d19d74ac90a2450cf979a92187e691ea5fa.zip |
add yue.is_ast().
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/macro.yue | 8 |
1 files changed, 8 insertions, 0 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 | ||
41 | macro NumAndStr = (num, str) -> | ||
42 | import "yue" | ||
43 | unless yue.is_ast("Num", "123") | ||
44 | error "unmatched tokens got" | ||
45 | "[#{num}, #{str}]" | ||
46 | |||
47 | print $NumAndStr 123, 'xyz' | ||
48 | |||
41 | $asserts item == nil | 49 | $asserts item == nil |
42 | 50 | ||
43 | $myconfig false | 51 | $myconfig false |