From 4350d996d1f4987ae83569acfdec2e25b996f599 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 5 Jan 2021 00:09:30 -0800 Subject: Simplified `...` to `..%\n` and `$.` to `./\n` --- compiler.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'compiler.c') diff --git a/compiler.c b/compiler.c index 7ee5fbe..69b2f10 100644 --- a/compiler.c +++ b/compiler.c @@ -111,14 +111,10 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) const char *origin = str; ++str; switch (c) { - // Any char (dot) ($. is multiline anychar) + // Any char (dot) case '.': { if (*str == '.') { // ".." ++str; - if (*str == '.') { // "..." - ++str; - op->multiline = 1; - } vm_op_t *till = bp_simplepattern(f, str); op->op = VM_UPTO_AND; op->len = -1; @@ -134,7 +130,6 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) } break; } else { - anychar: op->op = VM_ANYCHAR; op->len = 1; break; @@ -400,9 +395,6 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) if (matchchar(&str, c)) { // double __, ^^, $$ char tmp[3] = {c, c, '\0'}; op->args.s = strdup(tmp); - } else if (c == '$' && matchchar(&str, '.')) { // $. (multi-line anychar) - op->multiline = 1; - goto anychar; } else { op->args.s = strndup(&c, 1); } -- cgit v1.2.3