From b64bcbb6e7bd7f331f660518e97e2bfa898ae340 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 21 Jan 2017 21:13:33 -0800 Subject: bugfix: expand macros in a number of directives. This is the last round of changes on this topic, bringing proper macro expansion to the arguments to @(skip), @(fuzz), @(next), @(call), @(cat), @(load) and @(close). * match.c (match_expand_keyword_args): Only process the keyword arguments if they are followed by an argument. Process @(next) arguments here too: :list and :string take a Lisp expression, but :tlist and :var take an argument which is not a Lisp expression and must be handled properly. Also, expand any non-keyword expression. This handles the argument of @(next). (match_expand_elem): New function. * match.h (match_expand_elem): Declared. * parser.h (expand_meta): Declared. * parser.y (expand_meta): Static function becomes external. (elem): Expand elem other than require or do using match_expand_elem. We don't fold require and do into this because match_expand_elem has a backward compat switch in it that doesn't apply to these. --- match.h | 1 + 1 file changed, 1 insertion(+) (limited to 'match.h') diff --git a/match.h b/match.h index f911897f..a3b19f0f 100644 --- a/match.h +++ b/match.h @@ -29,6 +29,7 @@ extern val text_s, choose_s, gather_s, do_s, require_s; extern val close_s, load_s, include_s, mod_s, modlast_s, line_s; extern val counter_k, vars_k, env_k, var_k; val match_expand_keyword_args(val elem); +val match_expand_elem(val elem); val match_filter(val name, val arg, val other_args); val match_fun(val name, val args, val input, val files); val include(val specline); -- cgit v1.2.3