summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-09-27 13:29:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-09-27 13:29:49 -0700
commit0a4e0f2ff76761efe933d4ccae4c17efa286f4e3 (patch)
treebb5230f4d00084d5216438f56df0779efc1391b7 /match.c
parent2722c5140685064be3df771eb9c0e0feff4fded0 (diff)
downloadtxr-0a4e0f2ff76761efe933d4ccae4c17efa286f4e3.tar.gz
txr-0a4e0f2ff76761efe933d4ccae4c17efa286f4e3.tar.bz2
txr-0a4e0f2ff76761efe933d4ccae4c17efa286f4e3.zip
* lib.c (eof_s): New symbol variable.
(obj_init): New variable initialized. * lib.h (eof_s): Declared. * match.c (match_files): New @(eof) directive explicitly matches end of data. * txr.1: Updated.
Diffstat (limited to 'match.c')
-rw-r--r--match.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/match.c b/match.c
index a7284f19..73435770 100644
--- a/match.c
+++ b/match.c
@@ -1707,6 +1707,14 @@ repeat_spec_same_data:
if ((spec = rest(spec)) == nil)
break;
goto repeat_spec_same_data;
+ } else if (sym == eof_s) {
+ if (data) {
+ debugf(lit("eof failed to match at ~a"), num(data_lineno), nao);
+ return nil;
+ }
+ if ((spec = rest(spec)) == nil)
+ break;
+ goto repeat_spec_same_data;
} else {
val func = uw_get_func(sym);