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();
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user