mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
changes based on Python review
This commit is contained in:
@@ -858,7 +858,7 @@ module Impl implements RegexTreeViewSig {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
class RegExpAnchor extends RegExpSpecialChar {
|
class RegExpAnchor extends RegExpSpecialChar {
|
||||||
RegExpAnchor() { this.getChar() = ["^", "$"] }
|
RegExpAnchor() { this.getChar() = ["\\A", "^", "$", "\\Z"] }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -245,15 +245,11 @@ module Make<RegexTreeViewSig TreeImpl, HostnameRegexpSig<TreeImpl> Specific> {
|
|||||||
term.isRootTerm()
|
term.isRootTerm()
|
||||||
or
|
or
|
||||||
exists(RegExpTerm parent |
|
exists(RegExpTerm parent |
|
||||||
term = getLastChild(parent) and
|
term = parent.getLastChild() and
|
||||||
isRightArmTerm(parent)
|
isRightArmTerm(parent)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private RegExpTerm getLastChild(RegExpTerm parent) {
|
|
||||||
result = max(RegExpTerm child, int i | child = parent.getChild(i) | child order by i)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if `regexp` is a regular expression that is likely to match a hostname,
|
* Holds if `regexp` is a regular expression that is likely to match a hostname,
|
||||||
* but the pattern is incomplete and may match more hosts than intended.
|
* but the pattern is incomplete and may match more hosts than intended.
|
||||||
|
|||||||
Reference in New Issue
Block a user