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 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'spec/inputs') 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' -- cgit v1.2.3-55-g6feb