From f2b63cb849ea2f7ef571b82e7927cd4abef4414b Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 9 Aug 2024 11:35:27 +0800 Subject: add builtin macro $is_ast(). --- spec/inputs/macro.yue | 5 ++--- spec/outputs/macro.lua | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue index 3d4fb10..d5197da 100644 --- a/spec/inputs/macro.yue +++ b/spec/inputs/macro.yue @@ -39,9 +39,8 @@ print $WindowFlag( ) macro NumAndStr = (num, str) -> - import "yue" - unless yue.is_ast("Num", "123") - error "unmatched tokens got" + unless $is_ast(Num, num) and $is_ast SingleString, str + error "got unexpected token" "[#{num}, #{str}]" print $NumAndStr 123, 'xyz' diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua index 4492827..777f754 100644 --- a/spec/outputs/macro.lua +++ b/spec/outputs/macro.lua @@ -298,7 +298,7 @@ print((setmetatable({ return 998 end })) -print("current line: " .. tostring(309)) +print("current line: " .. tostring(308)) do -- TODO end -- cgit v1.2.3-55-g6feb