Regex: small error message improvement
This commit is contained in:
parent
c282b699d7
commit
7a313ddafe
|
@ -186,9 +186,11 @@ private:
|
||||||
case '[':
|
case '[':
|
||||||
++m_pos;
|
++m_pos;
|
||||||
return character_class();
|
return character_class();
|
||||||
default:
|
case '|': case ')':
|
||||||
if (contains("^$.*+?()[]{}|", cp))
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
default:
|
||||||
|
if (contains("^$.*+?[]{}", cp))
|
||||||
|
parse_error(format("unexpected '{}'", cp));
|
||||||
++m_pos;
|
++m_pos;
|
||||||
return new_node(ParsedRegex::Literal, cp);
|
return new_node(ParsedRegex::Literal, cp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user