summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-10-02 18:40:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-10-02 18:40:04 -0700
commit9adcae67bcac0f5d2d109e8921444517a1fb15b3 (patch)
treeff96eb31f3efec0a5c0c538565c842153b6361d8 /match.c
parent024f101e97197d1001cb9dd3403eee4a2e4c35bf (diff)
downloadtxr-9adcae67bcac0f5d2d109e8921444517a1fb15b3.tar.gz
txr-9adcae67bcac0f5d2d109e8921444517a1fb15b3.tar.bz2
txr-9adcae67bcac0f5d2d109e8921444517a1fb15b3.zip
* 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.
Diffstat (limited to 'match.c')
-rw-r--r--match.c17
1 files changed, 12 insertions, 5 deletions
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;