summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--match.c17
2 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index cf94b3b6..054b978c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-10-02 Kaz Kylheku <kaz@kylheku.com>
+ * 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 <kaz@kylheku.com>
+
Compiles as C++ again.
* lib.h (cons_set): New macro.
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;