From 9adcae67bcac0f5d2d109e8921444517a1fb15b3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Oct 2011 18:40:04 -0700 Subject: * match.c (match_line): Handle trailer_s directive. (match_files): Remove check against trailer_s not having trailing material. If it doesn't, it's a vertical directive processed here, otherwise leave it alone so match_line processed it. --- ChangeLog | 7 +++++++ match.c | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf94b3b6..054b978c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-02 Kaz Kylheku + + * match.c (match_line): Handle trailer_s directive. + (match_files): Remove check against trailer_s not having trailing + material. If it doesn't, it's a vertical directive processed here, + otherwise leave it alone so match_line processed it. + 2011-10-02 Kaz Kylheku Compiles as C++ again. diff --git a/match.c b/match.c index 673ca9e2..7c73e0eb 100644 --- a/match.c +++ b/match.c @@ -645,6 +645,17 @@ next_coll: } else { pos = max_pos; } + } else if (directive == trailer_s) { + cons_bind (new_bindings, new_pos, + match_line(bindings, rest(specline), dataline, pos, + spec_lineno, data_lineno, file)); + (void) new_bindings; + if (!new_pos) { + LOG_MISMATCH("trailer"); + return nil; + } + LOG_MATCH("trailer", new_pos); + return cons(bindings, pos); } else if (consp(directive) || stringp(directive)) { cons_bind (find, len, search_str_tree(dataline, elem, pos, nil)); val newpos; @@ -1185,11 +1196,7 @@ repeat_spec_same_data: debuglf(spec_linenum, lit("skip failed"), nao); return nil; - } else if (sym == trailer_s) { - if (rest(specline)) - sem_error(spec_linenum, - lit("unexpected material after trailer directive"), nao); - + } else if (sym == trailer_s && !rest(specline)) { if ((spec = rest(spec)) == nil) break; -- cgit v1.2.3