Regex: small error message improvement

This commit is contained in:
Maxime Coste 2017-09-26 23:42:54 +09:00
parent c282b699d7
commit 7a313ddafe

View File

@ -186,9 +186,11 @@ private:
case '[': case '[':
++m_pos; ++m_pos;
return character_class(); return character_class();
case '|': case ')':
return nullptr;
default: default:
if (contains("^$.*+?()[]{}|", cp)) if (contains("^$.*+?[]{}", cp))
return nullptr; parse_error(format("unexpected '{}'", cp));
++m_pos; ++m_pos;
return new_node(ParsedRegex::Literal, cp); return new_node(ParsedRegex::Literal, cp);
} }