зеркало из https://github.com/github/codeql.git
Python: fix computation at part boundaries
This commit is contained in:
Родитель
cdf1db09bd
Коммит
f5059a6918
|
@ -239,7 +239,7 @@ module Impl implements RegexTreeViewSig {
|
|||
* `localOffset` will be the offset of this `RegExpTerm` inside `result`.
|
||||
*/
|
||||
StringPart getPart(int localOffset) {
|
||||
exists(int index, int prefixLength | index = max(int i | this.getPartOffset(i) < start) |
|
||||
exists(int index, int prefixLength | index = max(int i | this.getPartOffset(i) <= start) |
|
||||
result = re.(StrConst).getImplicitlyConcatenatedPart(index) and
|
||||
result.contextSize(prefixLength, _) and
|
||||
// Example:
|
||||
|
|
|
@ -55,7 +55,7 @@ re.compile( # $ location=1:2 location=1:26
|
|||
)
|
||||
|
||||
# plain string with multiple parts across lines
|
||||
re.compile( # $ location=1:2 location=2:7 SPURIOUS:location=2:29 MISSING:location=3:2
|
||||
re.compile( # $ location=1:2 location=2:7 location=3:2
|
||||
'[this] is a test'
|
||||
' and [this] is another test'
|
||||
'[this] comes right at the start of a part'
|
||||
|
|
Загрузка…
Ссылка в новой задаче