Merge pull request #5302 from RasmusWL/expectation-tests-allow-str-prefix

Approved by MathiasVP, tausbn
This commit is contained in:
CodeQL CI
2021-03-04 06:48:57 -08:00
committed by GitHub
3 changed files with 9 additions and 3 deletions

View File

@@ -233,7 +233,9 @@ private string expectationPattern() {
exists(string tag, string tags, string value |
tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
value = "((?:\"[^\"]*\"|'[^']*'|\\S+)*)" and
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
// For example, `b"foo"`.
value = "((?:[bru]*\"[^\"]*\"|[bru]*'[^']*'|\\S+)*)" and
result = tags + "(?:=" + value + ")?"
)
}