mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-20 01:41:40 +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);
|
AstNodePtr res = new_node(op);
|
||||||
while (auto node = term())
|
while (auto node = term())
|
||||||
res->children.push_back(std::move(node));
|
res->children.push_back(std::move(node));
|
||||||
if (res->children.empty())
|
|
||||||
parse_error("empty alternative");
|
|
||||||
return res;
|
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::WordBoundary);
|
||||||
case 'B': m_pos += 2; return new_node(ParsedRegex::NotWordBoundary);
|
case 'B': m_pos += 2; return new_node(ParsedRegex::NotWordBoundary);
|
||||||
case '`': m_pos += 2; return new_node(ParsedRegex::SubjectBegin);
|
case 'A': m_pos += 2; return new_node(ParsedRegex::SubjectBegin);
|
||||||
case '\'': m_pos += 2; return new_node(ParsedRegex::SubjectEnd);
|
case 'z': m_pos += 2; return new_node(ParsedRegex::SubjectEnd);
|
||||||
case 'K': m_pos += 2; return new_node(ParsedRegex::ResetStart);
|
case 'K': m_pos += 2; return new_node(ParsedRegex::ResetStart);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user