aboutsummaryrefslogtreecommitdiff
path: root/compiler.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-05 00:09:30 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-05 00:09:30 -0800
commit4350d996d1f4987ae83569acfdec2e25b996f599 (patch)
tree835ab3332ec593c748f4eabd7490266b2e22aa30 /compiler.c
parent8d14bf01bc3c3cfbb3613487b59fe0bc4d6efba6 (diff)
Simplified `...` to `..%\n` and `$.` to `./\n`
Diffstat (limited to 'compiler.c')
-rw-r--r--compiler.c10
1 files changed, 1 insertions, 9 deletions
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);
}