From 80b0ff0b5f3a0376906fc428fc43aafc02ca07f9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 1 Sep 2020 06:51:35 -0700 Subject: tags: address small issue with tag lookup. Exuberant Ctags uses the full content of one line as the key to find a tag. A function declaration that is split into multiple lines can have a first line which is identical to the definition, as in: static int add(int a, int b); static int add(int a, int b) { return a + b; } Here, the search key which ctags uses for the add function is "static int add(int a,", taken from the definition. But it's exactly the same as a the first line of the declaration, and that is what Vim jumps to for that tag. A few function declarations in TXR have this issue. * eval.c (expand_params_rec, do_eval): Make the first line of the forward declaration different from the first line of the definition. * match.c (mf_all): Likewise. * struct.c (make_struct_type_compat): Likewise. --- eval.c | 8 ++++---- match.c | 4 ++-- struct.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eval.c b/eval.c index de2acf92..6752ad18 100644 --- a/eval.c +++ b/eval.c @@ -984,8 +984,8 @@ static val make_var_shadowing_env(val menv, val vars); static val get_param_syms(val params); -static val expand_params_rec(val params, val menv, - val macro_style_p, val form); +static val expand_params_rec(val params, val menv, val macro_style_p, + val form); static val expand_opt_params_rec(val params, val menv, val macro_style_p, val form) @@ -1431,8 +1431,8 @@ nil_out: return nil; } -static val do_eval(val form, val env, val ctx, - val (*lookup)(val env, val sym)); +static val do_eval(val form, val env, + val ctx, val (*lookup)(val env, val sym)); static void do_eval_args(val form, val env, val ctx, val (*lookup)(val env, val sym), diff --git a/match.c b/match.c index c2ac517b..0e066fe9 100644 --- a/match.c +++ b/match.c @@ -1487,8 +1487,8 @@ typedef struct { val spec, files, curfile, bindings, data, data_lineno; } match_files_ctx; -static match_files_ctx mf_all(val spec, val files, val bindings, - val data, val curfile); +static match_files_ctx mf_all(val spec, val files, val bindings, val data, + val curfile); static val v_fun(match_files_ctx *c); diff --git a/struct.c b/struct.c index a7d3b79c..43908f8c 100644 --- a/struct.c +++ b/struct.c @@ -126,8 +126,8 @@ static val struct_type_finalize(val obj); static_forward(struct cobj_ops struct_type_ops); static struct stslot *lookup_static_slot_desc(struct struct_type *st, val sym); -static val make_struct_type_compat(val name, val super, val slots, - val initfun, val boactor); +static val make_struct_type_compat(val name, val super, + val slots, val initfun, val boactor); static val call_super_method(val inst, val sym, struct args *); static val call_super_fun(val type, val sym, struct args *); -- cgit v1.2.3