diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 957f993b..09c8cc02 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -745,12 +745,12 @@ private: case ParsedRegex::ResetStart: return true; case ParsedRegex::LookAhead: - if (node->children.empty()) + if (not node->children.empty()) compute_start_chars(m_forward ? node->children.front() : node->children.back(), accepted, rejected); return true; case ParsedRegex::NegativeLookAhead: - if (node->children.empty()) + if (not node->children.empty()) compute_start_chars(m_forward ? node->children.front() : node->children.back(), rejected, accepted); return true; @@ -1124,6 +1124,11 @@ auto test_regex = UnitTest{[]{ kak_assert(vm.exec("# foo bar", RegexExecFlags::Search)); kak_assert(*vm.captures()[0] == '#'); } + + { + TestVM<> vm{R"((?=))"}; + kak_assert(vm.exec("")); + } }}; }