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 '[':
++m_pos;
return character_class();
default:
if (contains("^$.*+?()[]{}|", cp))
case '|': case ')':
return nullptr;
default:
if (contains("^$.*+?[]{}", cp))
parse_error(format("unexpected '{}'", cp));
++m_pos;
return new_node(ParsedRegex::Literal, cp);
}