diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-02 22:36:26 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-11-01 14:05:14 +0800 |
| commit | 51ad8b4c8545279a6af0a7b87fcd29af4e5735cb (patch) | |
| tree | 8c6e082b3aaadfd4ee0125af818cf0ffca8f8e14 /src | |
| parent | adcd02b7d221fc14a3814a2f7d90f7a1e8791d62 (diff) | |
Regex: fix handling of negative escaped character classes
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex_impl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index f79afb57..32d186c5 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -271,8 +271,8 @@ private: auto matcher_id = m_parsed_regex.matchers.size(); m_parsed_regex.matchers.push_back( [ctype = character_class.ctype ? wctype(character_class.ctype) : (wctype_t)0, - chars = character_class.additional_chars] (Codepoint cp) { - return (ctype != 0 and iswctype(cp, ctype)) or contains(chars, cp); + chars = character_class.additional_chars, neg = character_class.neg] (Codepoint cp) { + return ((ctype != 0 and iswctype(cp, ctype)) or contains(chars, cp)) != neg; }); return new_node(ParsedRegex::Matcher, matcher_id); } |
