mirror of
https://github.com/github/codeql.git
synced 2025-12-28 14:46:33 +01:00
Break the recursion between seqChild, RegExpTerm and TRegExpSequence
This commit is contained in:
committed by
Joe Farebrother
parent
0d13864bc8
commit
bc17d4b91f
@@ -20,7 +20,11 @@ private newtype TRegExpParent =
|
||||
/** A sequence term */
|
||||
TRegExpSequence(Regex re, int start, int end) {
|
||||
re.sequence(start, end) and
|
||||
exists(seqChild(re, start, end, 1)) // if a sequence does not have more than one element, it should be treated as that element instead.
|
||||
// Only create sequence nodes for sequences with two or more children.
|
||||
exists(int mid |
|
||||
re.item(start, mid) and
|
||||
re.item(mid, _)
|
||||
)
|
||||
} or
|
||||
/** An alternation term */
|
||||
TRegExpAlt(Regex re, int start, int end) {
|
||||
|
||||
Reference in New Issue
Block a user