diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 15:13:54 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 15:13:54 -0700 |
| commit | 88571d7639d1bfa134b9b4f89ddd031b11fe8f69 (patch) | |
| tree | 9cd12006b10ed1794139928b0490ceb6ca68a3eb /compiler.c | |
| parent | 344c1b1709de522e07b97fe39afa96f46dd74515 (diff) | |
More intuitive escape sequences for string patterns
Diffstat (limited to 'compiler.c')
| -rw-r--r-- | compiler.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -395,6 +395,12 @@ vm_op_t *bpeg_stringpattern(file_t *f, const char *str) for (; *str; str++) { if (*str == '\\') { check(str[1], "Expected more string contents after backslash"); + const char *after_escape; + char e = unescapechar(&str[1], &after_escape); + if (e != str[1]) { + str = after_escape - 1; + continue; + } if (str[1] == '\\') { ++str; continue; |
