summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2010-01-13 12:24:00 -0800
committerKaz Kylheku <kaz@kylheku.com>2010-01-13 12:24:00 -0800
commitb839b5a212fdd77c5dc95b684d7e6790292bb3dc (patch)
tree12aa13021e6af8b1a276e6bc00f712b76ee1631a /match.c
parentc017faf62d69d43219f7d1d651f7a46083f8a6a4 (diff)
downloadtxr-b839b5a212fdd77c5dc95b684d7e6790292bb3dc.tar.gz
txr-b839b5a212fdd77c5dc95b684d7e6790292bb3dc.tar.bz2
txr-b839b5a212fdd77c5dc95b684d7e6790292bb3dc.zip
Impelement derivative-based regular expressions.
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/match.c b/match.c
index bdf7714d..c9d45670 100644
--- a/match.c
+++ b/match.c
@@ -368,7 +368,7 @@ static val match_line(val bindings, val specline, val dataline,
LOG_MATCH("var delimiting string", find);
bindings = acons_new(bindings, sym, sub_str(dataline, pos, find));
pos = plus(find, length_str(pat));
- } else if (consp(pat) && typeof(first(pat)) == regex_s) {
+ } else if (consp(pat) && regexp(first(pat))) {
val find = search_regex(dataline, first(pat), pos, modifier);
val fpos = car(find);
val flen = cdr(find);
@@ -412,7 +412,7 @@ static val match_line(val bindings, val specline, val dataline,
sem_error(spec_lineno,
lit("variable followed by invalid element"), nao);
}
- } else if (typeof(directive) == regex_s) {
+ } else if (regexp(directive)) {
val past = match_regex(dataline, directive, pos);
if (nullp(past)) {
LOG_MISMATCH("regex");