diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-12-14 18:11:33 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-12-14 18:11:33 -0800 |
| commit | c43e4781763ee3f3f148e821a88e99c6b80c58db (patch) | |
| tree | 53efc5bdee0f16d6e39e5fcae9888c0b21f06ad2 /compiler.c | |
| parent | 41639915dedfb9e6ec15e2851538b34d0562660b (diff) | |
Added % operator to ..
Diffstat (limited to 'compiler.c')
| -rw-r--r-- | compiler.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -117,9 +117,16 @@ vm_op_t *bpeg_simplepattern(file_t *f, const char *str) vm_op_t *till = bpeg_simplepattern(f, str); op->op = VM_UPTO_AND; op->len = -1; - op->args.pat = till; + op->args.multiple.first = till; if (till) str = till->end; + if (matchchar(&str, '%')) { + vm_op_t *skip = bpeg_simplepattern(f, str); + if (!skip) + file_err(f, str, str, "There should be a pattern to skip here after the '%%'"); + op->args.multiple.second = skip; + str = skip->end; + } break; } else { anychar: |
