diff --git a/rc/base/haskell.kak b/rc/base/haskell.kak index cf06fade..25c62861 100644 --- a/rc/base/haskell.kak +++ b/rc/base/haskell.kak @@ -39,7 +39,7 @@ add-highlighter shared/haskell/code regex (?ctype; ++m_pos; continue; } - else // its just an escaped character + else // its an escaped character { cp = *m_pos++; - for (auto& control : control_escapes) - { - if (control.name == cp) - { - cp = control.value; - break; - } - } + auto it = find_if(control_escapes, [cp](auto&& t) { return t.name == cp; }); + if (it != std::end(control_escapes)) + cp = it->value; + else if (not contains("^$\\.*+?()[]{}|-", cp)) // SyntaxCharacter and - + parse_error(format("unknown character class escape '{}'", cp)); } }