Parse repeats in regex patterns
This commit is contained in:
parent
92e73a9e70
commit
100ab56779
2 changed files with 24 additions and 1 deletions
|
|
@ -32,7 +32,12 @@ namespace tree_sitter {
|
|||
}
|
||||
|
||||
rule_ptr factor() {
|
||||
return atom();
|
||||
rule_ptr result = atom();
|
||||
if (has_more_input() && (peek() == '+')) {
|
||||
next();
|
||||
result = repeat(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
rule_ptr atom() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue