Skip to content

Commit 96a1464

Browse files
committed
Merge branch 'main' into HEAD
2 parents 672ac8c + 5adc9f8 commit 96a1464

File tree

11 files changed

+48275
-38235
lines changed

11 files changed

+48275
-38235
lines changed

python/extractor/semmle/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#Semantic version of extractor.
1212
#Update this if any changes are made
13-
VERSION = "7.1.7"
13+
VERSION = "7.1.8"
1414

1515
PY_EXTENSIONS = ".py", ".pyw"
1616

python/extractor/tests/parser/strings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@
8686
if 39:
8787
r'a\
8888
'
89+
if 40:
90+
f"{x:=^20}"

python/extractor/tests/parser/template_strings_new.expected

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Module: [1, 0] - [18, 0]
1+
Module: [1, 0] - [20, 0]
22
body: [
33
Assign: [1, 0] - [1, 14]
44
targets: [
@@ -191,4 +191,24 @@ Module: [1, 0] - [18, 0]
191191
]
192192
]
193193
orelse: None
194+
If: [18, 0] - [18, 5]
195+
test:
196+
Num: [18, 3] - [18, 4]
197+
n: 7
198+
text: '7'
199+
body: [
200+
Expr: [19, 4] - [19, 43]
201+
value:
202+
TemplateString: [19, 4] - [19, 43]
203+
prefix: 't"'
204+
values: [
205+
TemplateStringPart: [19, 6] - [19, 31]
206+
text: '"With a format specifier: "'
207+
s: 'With a format specifier: '
208+
Name: [19, 32] - [19, 36]
209+
variable: Variable('name', None)
210+
ctx: Load
211+
]
212+
]
213+
orelse: None
194214
]

python/extractor/tests/parser/template_strings_new.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
t"Multiple {first} and {second} placeholders."
1616
if 6:
1717
t"Implicit concatenation: " t"Hello, {name}!" t" How are you?"
18+
if 7:
19+
t"With a format specifier: {name:=^20}"

python/extractor/tsg-python/tsp/grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ module.exports = grammar({
11681168
_not_escape_sequence: $ => token.immediate('\\'),
11691169

11701170
format_specifier: $ => seq(
1171-
':',
1171+
token(prec(1,':')),
11721172
repeat(choice(
11731173
token(prec(1, /[^{}\n]+/)),
11741174
alias($.interpolation, $.format_expression)

python/extractor/tsg-python/tsp/src/grammar.json

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/extractor/tsg-python/tsp/src/node-types.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)