diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-20 18:26:33 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-11-01 14:05:15 +0800 |
| commit | 60e32d73ffb0d98febffec78d4ed38b748fab465 (patch) | |
| tree | 7c897cbcd063d8a358d7c7f00a35b71c668247c2 /src | |
| parent | df2bf9601cffcb0387da40e664e487123d64b59b (diff) | |
Regex: Fix handling of all unicode codepoint as start chars
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex_impl.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 8b6626fb..993119b9 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -858,6 +858,8 @@ private: else start_chars.map[node->value] = true; } + else + start_chars.accept_other = true; return node->quantifier.allows_none(); case ParsedRegex::AnyChar: for (auto& b : start_chars.map) @@ -1333,6 +1335,11 @@ auto test_regex = UnitTest{[]{ } { + TestVM<> vm{R"(д)"}; + kak_assert(vm.exec("д", RegexExecFlags::Search)); + } + + { TestVM<> vm{R"(\0\x0A\u260e\u260F)"}; const char str[] = "\0\n☎☏"; // work around the null byte in the literal kak_assert(vm.exec({str, str + sizeof(str)-1})); |
