Parse repeats in regex patterns
This commit is contained in:
parent
92e73a9e70
commit
100ab56779
2 changed files with 24 additions and 1 deletions
|
|
@ -60,4 +60,22 @@ Describe(pattern_rules) {
|
|||
character('b')
|
||||
})->to_string()));
|
||||
}
|
||||
|
||||
It(parses_repeating_rules) {
|
||||
pattern_ptr rule = pattern("(ab)+(cd)+");
|
||||
AssertThat(
|
||||
rule->to_rule_tree()->to_string(),
|
||||
Equals(
|
||||
seq({
|
||||
repeat(seq({
|
||||
character('a'),
|
||||
character('b')
|
||||
})),
|
||||
repeat(seq({
|
||||
character('c'),
|
||||
character('d')
|
||||
})),
|
||||
})->to_string()
|
||||
));
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue