From 907101b42159c3d2a8ee74540fb8e9259b36db7e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 28 Sep 2020 16:35:22 -0700 Subject: Fixes for captures and backrefs, and added block comments --- compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler.c') diff --git a/compiler.c b/compiler.c index 49c4996..1f2d9ff 100644 --- a/compiler.c +++ b/compiler.c @@ -267,7 +267,7 @@ vm_op_t *bpeg_simplepattern(file_t *f, const char *str) case '@': { op->op = VM_CAPTURE; const char *a = *str == '!' ? &str[1] : after_name(str); - if (a > str && *after_spaces(a) == '=') { + if (a > str && a[0] == '=' && a[1] != '>') { op->args.capture.name = strndup(str, (size_t)(a-str)); str = a + 1; } -- cgit v1.2.3