mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-19 17:31:44 +03:00
Regex: use \A \z for subject start/end
This is the most common syntax in various regex variants.
This commit is contained in:
parent
0bdfdac5c5
commit
7673781751
@ -125,8 +125,6 @@ private:
|
||||
AstNodePtr res = new_node(op);
|
||||
while (auto node = term())
|
||||
res->children.push_back(std::move(node));
|
||||
if (res->children.empty())
|
||||
parse_error("empty alternative");
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -158,8 +156,8 @@ private:
|
||||
{
|
||||
case 'b': m_pos += 2; return new_node(ParsedRegex::WordBoundary);
|
||||
case 'B': m_pos += 2; return new_node(ParsedRegex::NotWordBoundary);
|
||||
case '`': m_pos += 2; return new_node(ParsedRegex::SubjectBegin);
|
||||
case '\'': m_pos += 2; return new_node(ParsedRegex::SubjectEnd);
|
||||
case 'A': m_pos += 2; return new_node(ParsedRegex::SubjectBegin);
|
||||
case 'z': m_pos += 2; return new_node(ParsedRegex::SubjectEnd);
|
||||
case 'K': m_pos += 2; return new_node(ParsedRegex::ResetStart);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user