diff options
author | Matthäus G. Chajdas <dev@anteru.net> | 2022-12-11 12:52:23 +0100 |
---|---|---|
committer | Matthäus G. Chajdas <dev@anteru.net> | 2022-12-11 12:52:23 +0100 |
commit | 147b22face65617514ccfa8512c6b097b07cad4c (patch) | |
tree | 56a06e1627d9e159f84becb4664d0ec46788a8f5 /tests/snippets/python | |
parent | 956518d6d6b62e755f8a3869c5cb143a243fdc4d (diff) | |
download | pygments-git-147b22face65617514ccfa8512c6b097b07cad4c.tar.gz |
Improve whitespace handling in Python.
This triggers a new case in the HtmlFormatter, which emits an empty span
at the end of the line for a new line, as those are removed by the
split-by-parts code. This requires separate post-processing.
Doesn't fix all whitespace issues with Python either, but we're done to
360 failing examples with that, from previously >400.
Diffstat (limited to 'tests/snippets/python')
79 files changed, 124 insertions, 124 deletions
diff --git a/tests/snippets/python/test_bytes_escape_codes.txt b/tests/snippets/python/test_bytes_escape_codes.txt index 19948d7e..c1a34437 100644 --- a/tests/snippets/python/test_bytes_escape_codes.txt +++ b/tests/snippets/python/test_bytes_escape_codes.txt @@ -21,4 +21,4 @@ b'\\ \n \x12 \777 \u1234 \U00010348 \N{Plus-Minus Sign}' '{' Literal.String.Single 'Plus-Minus Sign}' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_floats.txt b/tests/snippets/python/test_floats.txt index 20bb1d79..3ae9dc96 100644 --- a/tests/snippets/python/test_floats.txt +++ b/tests/snippets/python/test_floats.txt @@ -72,4 +72,4 @@ ' ' Text '5.67' Literal.Number.Float '_' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_01a.txt b/tests/snippets/python/test_fstring_01a.txt index 406e2cc8..a3b29a35 100644 --- a/tests/snippets/python/test_fstring_01a.txt +++ b/tests/snippets/python/test_fstring_01a.txt @@ -22,4 +22,4 @@ f'My name is {name}, my age next year is {age+1}, my anniversary is {anniversary '}' Literal.String.Interpol '.' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_01b.txt b/tests/snippets/python/test_fstring_01b.txt index 278258e2..0d2c3437 100644 --- a/tests/snippets/python/test_fstring_01b.txt +++ b/tests/snippets/python/test_fstring_01b.txt @@ -22,4 +22,4 @@ f"My name is {name}, my age next year is {age+1}, my anniversary is {anniversary '}' Literal.String.Interpol '.' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_02a.txt b/tests/snippets/python/test_fstring_02a.txt index 359c13be..cfd41a97 100644 --- a/tests/snippets/python/test_fstring_02a.txt +++ b/tests/snippets/python/test_fstring_02a.txt @@ -10,4 +10,4 @@ f'He said his name is {name!r}.' '!r}' Literal.String.Interpol '.' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_02b.txt b/tests/snippets/python/test_fstring_02b.txt index abef1600..c72a77b8 100644 --- a/tests/snippets/python/test_fstring_02b.txt +++ b/tests/snippets/python/test_fstring_02b.txt @@ -10,4 +10,4 @@ f"He said his name is {name!r}." '!r}' Literal.String.Interpol '.' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_03a.txt b/tests/snippets/python/test_fstring_03a.txt index 3edee4cf..366e4951 100644 --- a/tests/snippets/python/test_fstring_03a.txt +++ b/tests/snippets/python/test_fstring_03a.txt @@ -11,4 +11,4 @@ f'input={value:#06x}' '#06x' Literal.String.Single '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_03b.txt b/tests/snippets/python/test_fstring_03b.txt index f7723898..260e56d1 100644 --- a/tests/snippets/python/test_fstring_03b.txt +++ b/tests/snippets/python/test_fstring_03b.txt @@ -11,4 +11,4 @@ f"input={value:#06x}" '#06x' Literal.String.Double '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_04a.txt b/tests/snippets/python/test_fstring_04a.txt index 85619ab8..58516c91 100644 --- a/tests/snippets/python/test_fstring_04a.txt +++ b/tests/snippets/python/test_fstring_04a.txt @@ -10,4 +10,4 @@ f'{"quoted string"}' '"' Literal.String.Double '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_04b.txt b/tests/snippets/python/test_fstring_04b.txt index bd6308c2..40e1ea08 100644 --- a/tests/snippets/python/test_fstring_04b.txt +++ b/tests/snippets/python/test_fstring_04b.txt @@ -10,4 +10,4 @@ f"{'quoted string'}" "'" Literal.String.Single '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_05a.txt b/tests/snippets/python/test_fstring_05a.txt index 18074571..77a5c10a 100644 --- a/tests/snippets/python/test_fstring_05a.txt +++ b/tests/snippets/python/test_fstring_05a.txt @@ -13,4 +13,4 @@ f'{f"{inner}"}' '"' Literal.String.Double '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_05b.txt b/tests/snippets/python/test_fstring_05b.txt index b0f3ebd8..9a0dc5af 100644 --- a/tests/snippets/python/test_fstring_05b.txt +++ b/tests/snippets/python/test_fstring_05b.txt @@ -13,4 +13,4 @@ f"{f'{inner}'}" "'" Literal.String.Single '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_06a.txt b/tests/snippets/python/test_fstring_06a.txt index 0ba0809a..b8b33c0a 100644 --- a/tests/snippets/python/test_fstring_06a.txt +++ b/tests/snippets/python/test_fstring_06a.txt @@ -13,4 +13,4 @@ f'{\'quoted string\'}' "\\'" Literal.String.Escape '}' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_06b.txt b/tests/snippets/python/test_fstring_06b.txt index f98b3dc2..0712321b 100644 --- a/tests/snippets/python/test_fstring_06b.txt +++ b/tests/snippets/python/test_fstring_06b.txt @@ -13,4 +13,4 @@ f"{\"quoted string\"}" '\\"' Literal.String.Escape '}' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_07a.txt b/tests/snippets/python/test_fstring_07a.txt index 63942200..c597ea97 100644 --- a/tests/snippets/python/test_fstring_07a.txt +++ b/tests/snippets/python/test_fstring_07a.txt @@ -14,4 +14,4 @@ f'{{ {4*10} }}' ' ' Literal.String.Single '}}' Literal.String.Escape "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_07b.txt b/tests/snippets/python/test_fstring_07b.txt index c7e87bc7..413c1585 100644 --- a/tests/snippets/python/test_fstring_07b.txt +++ b/tests/snippets/python/test_fstring_07b.txt @@ -14,4 +14,4 @@ f"{{ {4*10} }}" ' ' Literal.String.Double '}}' Literal.String.Escape '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_08a.txt b/tests/snippets/python/test_fstring_08a.txt index 61b6cc8f..39dd887b 100644 --- a/tests/snippets/python/test_fstring_08a.txt +++ b/tests/snippets/python/test_fstring_08a.txt @@ -12,4 +12,4 @@ f'{{{4*10}}}' '}' Literal.String.Interpol '}}' Literal.String.Escape "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_08b.txt b/tests/snippets/python/test_fstring_08b.txt index 41eb13a4..458c6978 100644 --- a/tests/snippets/python/test_fstring_08b.txt +++ b/tests/snippets/python/test_fstring_08b.txt @@ -12,4 +12,4 @@ f"{{{4*10}}}" '}' Literal.String.Interpol '}}' Literal.String.Escape '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_09a.txt b/tests/snippets/python/test_fstring_09a.txt index 3dcec51e..00f3e7f1 100644 --- a/tests/snippets/python/test_fstring_09a.txt +++ b/tests/snippets/python/test_fstring_09a.txt @@ -11,4 +11,4 @@ fr'x={4*10}' '10' Literal.Number.Integer '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_09b.txt b/tests/snippets/python/test_fstring_09b.txt index 72932b29..01d74e95 100644 --- a/tests/snippets/python/test_fstring_09b.txt +++ b/tests/snippets/python/test_fstring_09b.txt @@ -11,4 +11,4 @@ fr"x={4*10}" '10' Literal.Number.Integer '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_10a.txt b/tests/snippets/python/test_fstring_10a.txt index 02fba2b4..a2e11ba2 100644 --- a/tests/snippets/python/test_fstring_10a.txt +++ b/tests/snippets/python/test_fstring_10a.txt @@ -15,4 +15,4 @@ f'abc {a["x"]} def' '}' Literal.String.Interpol ' def' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_10b.txt b/tests/snippets/python/test_fstring_10b.txt index 46150935..21d116c7 100644 --- a/tests/snippets/python/test_fstring_10b.txt +++ b/tests/snippets/python/test_fstring_10b.txt @@ -15,4 +15,4 @@ f"abc {a['x']} def" '}' Literal.String.Interpol ' def' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_11a.txt b/tests/snippets/python/test_fstring_11a.txt index 6116c960..ce20e7b8 100644 --- a/tests/snippets/python/test_fstring_11a.txt +++ b/tests/snippets/python/test_fstring_11a.txt @@ -15,4 +15,4 @@ f'''abc {a['x']} def''' '}' Literal.String.Interpol ' def' Literal.String.Single "'''" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_11b.txt b/tests/snippets/python/test_fstring_11b.txt index 77c3d6f8..baf13701 100644 --- a/tests/snippets/python/test_fstring_11b.txt +++ b/tests/snippets/python/test_fstring_11b.txt @@ -15,4 +15,4 @@ f"""abc {a["x"]} def""" '}' Literal.String.Interpol ' def' Literal.String.Double '"""' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_12a.txt b/tests/snippets/python/test_fstring_12a.txt index cc8eeab4..99888040 100644 --- a/tests/snippets/python/test_fstring_12a.txt +++ b/tests/snippets/python/test_fstring_12a.txt @@ -7,10 +7,10 @@ f'''{x "'''" Literal.String.Single '{' Literal.String.Interpol 'x' Name -'\n' Text +'\n' Text.Whitespace '+' Operator '1' Literal.Number.Integer '}' Literal.String.Interpol "'''" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_12b.txt b/tests/snippets/python/test_fstring_12b.txt index 160b2d91..878b7a0b 100644 --- a/tests/snippets/python/test_fstring_12b.txt +++ b/tests/snippets/python/test_fstring_12b.txt @@ -7,10 +7,10 @@ f"""{x '"""' Literal.String.Double '{' Literal.String.Interpol 'x' Name -'\n' Text +'\n' Text.Whitespace '+' Operator '1' Literal.Number.Integer '}' Literal.String.Interpol '"""' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_13a.txt b/tests/snippets/python/test_fstring_13a.txt index b556a5b6..e6e97e86 100644 --- a/tests/snippets/python/test_fstring_13a.txt +++ b/tests/snippets/python/test_fstring_13a.txt @@ -9,9 +9,9 @@ f'''{d[0 'd' Name '[' Punctuation '0' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace ']' Punctuation '}' Literal.String.Interpol "'''" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_13b.txt b/tests/snippets/python/test_fstring_13b.txt index 1e9fd60d..0a3aa56d 100644 --- a/tests/snippets/python/test_fstring_13b.txt +++ b/tests/snippets/python/test_fstring_13b.txt @@ -9,9 +9,9 @@ f"""{d[0 'd' Name '[' Punctuation '0' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace ']' Punctuation '}' Literal.String.Interpol '"""' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_14a.txt b/tests/snippets/python/test_fstring_14a.txt index de202a21..a826835b 100644 --- a/tests/snippets/python/test_fstring_14a.txt +++ b/tests/snippets/python/test_fstring_14a.txt @@ -17,4 +17,4 @@ f'result: {value:{width}.{precision}}' '}' Literal.String.Interpol '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_14b.txt b/tests/snippets/python/test_fstring_14b.txt index 83aaad5e..31008833 100644 --- a/tests/snippets/python/test_fstring_14b.txt +++ b/tests/snippets/python/test_fstring_14b.txt @@ -17,4 +17,4 @@ f"result: {value:{width}.{precision}}" '}' Literal.String.Interpol '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_15a.txt b/tests/snippets/python/test_fstring_15a.txt index 635e8791..f8f62b82 100644 --- a/tests/snippets/python/test_fstring_15a.txt +++ b/tests/snippets/python/test_fstring_15a.txt @@ -39,4 +39,4 @@ "'" Literal.String.Single 'e' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_15b.txt b/tests/snippets/python/test_fstring_15b.txt index 1a1ab251..7b5307c1 100644 --- a/tests/snippets/python/test_fstring_15b.txt +++ b/tests/snippets/python/test_fstring_15b.txt @@ -39,4 +39,4 @@ '"' Literal.String.Double 'e' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_16a.txt b/tests/snippets/python/test_fstring_16a.txt index cbd4d14b..15b11e83 100644 --- a/tests/snippets/python/test_fstring_16a.txt +++ b/tests/snippets/python/test_fstring_16a.txt @@ -15,4 +15,4 @@ f'{i}:{d[i]}' ']' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_16b.txt b/tests/snippets/python/test_fstring_16b.txt index 8ce173f0..e917516f 100644 --- a/tests/snippets/python/test_fstring_16b.txt +++ b/tests/snippets/python/test_fstring_16b.txt @@ -15,4 +15,4 @@ f"{i}:{d[i]}" ']' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_17a.txt b/tests/snippets/python/test_fstring_17a.txt index a1b5b3a5..9eefd918 100644 --- a/tests/snippets/python/test_fstring_17a.txt +++ b/tests/snippets/python/test_fstring_17a.txt @@ -11,4 +11,4 @@ f'x = {x:+3}' '+3' Literal.String.Single '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_17b.txt b/tests/snippets/python/test_fstring_17b.txt index 5f34b174..2d264814 100644 --- a/tests/snippets/python/test_fstring_17b.txt +++ b/tests/snippets/python/test_fstring_17b.txt @@ -11,4 +11,4 @@ f"x = {x:+3}" '+3' Literal.String.Double '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_18a.txt b/tests/snippets/python/test_fstring_18a.txt index 60d05123..5455db73 100644 --- a/tests/snippets/python/test_fstring_18a.txt +++ b/tests/snippets/python/test_fstring_18a.txt @@ -22,4 +22,4 @@ f'{fn(lst,2)} {fn(lst,3)}' ')' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_18b.txt b/tests/snippets/python/test_fstring_18b.txt index a189d00a..356cc3c7 100644 --- a/tests/snippets/python/test_fstring_18b.txt +++ b/tests/snippets/python/test_fstring_18b.txt @@ -22,4 +22,4 @@ f"{fn(lst,2)} {fn(lst,3)}" ')' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_19a.txt b/tests/snippets/python/test_fstring_19a.txt index 6e412a38..7e7cde0d 100644 --- a/tests/snippets/python/test_fstring_19a.txt +++ b/tests/snippets/python/test_fstring_19a.txt @@ -6,41 +6,41 @@ f'mapping is { {a:b for (a, b) in ((1, 2), (3, 4))} }' "'" Literal.String.Single 'mapping is ' Literal.String.Single '{' Literal.String.Interpol -' ' Text +' ' Text.Whitespace '{' Punctuation 'a' Name ':' Punctuation 'b' Name -' ' Text +' ' Text.Whitespace 'for' Keyword -' ' Text +' ' Text.Whitespace '(' Punctuation 'a' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'b' Name ')' Punctuation -' ' Text +' ' Text.Whitespace 'in' Operator.Word -' ' Text +' ' Text.Whitespace '(' Punctuation '(' Punctuation '1' Literal.Number.Integer ',' Punctuation -' ' Text +' ' Text.Whitespace '2' Literal.Number.Integer ')' Punctuation ',' Punctuation -' ' Text +' ' Text.Whitespace '(' Punctuation '3' Literal.Number.Integer ',' Punctuation -' ' Text +' ' Text.Whitespace '4' Literal.Number.Integer ')' Punctuation ')' Punctuation '}' Punctuation -' ' Text +' ' Text.Whitespace '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_19b.txt b/tests/snippets/python/test_fstring_19b.txt index 5c9d6f73..3ae438a0 100644 --- a/tests/snippets/python/test_fstring_19b.txt +++ b/tests/snippets/python/test_fstring_19b.txt @@ -6,41 +6,41 @@ f"mapping is { {a:b for (a, b) in ((1, 2), (3, 4))} }" '"' Literal.String.Double 'mapping is ' Literal.String.Double '{' Literal.String.Interpol -' ' Text +' ' Text.Whitespace '{' Punctuation 'a' Name ':' Punctuation 'b' Name -' ' Text +' ' Text.Whitespace 'for' Keyword -' ' Text +' ' Text.Whitespace '(' Punctuation 'a' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'b' Name ')' Punctuation -' ' Text +' ' Text.Whitespace 'in' Operator.Word -' ' Text +' ' Text.Whitespace '(' Punctuation '(' Punctuation '1' Literal.Number.Integer ',' Punctuation -' ' Text +' ' Text.Whitespace '2' Literal.Number.Integer ')' Punctuation ',' Punctuation -' ' Text +' ' Text.Whitespace '(' Punctuation '3' Literal.Number.Integer ',' Punctuation -' ' Text +' ' Text.Whitespace '4' Literal.Number.Integer ')' Punctuation ')' Punctuation '}' Punctuation -' ' Text +' ' Text.Whitespace '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_20a.txt b/tests/snippets/python/test_fstring_20a.txt index a72a7a44..206e436f 100644 --- a/tests/snippets/python/test_fstring_20a.txt +++ b/tests/snippets/python/test_fstring_20a.txt @@ -14,4 +14,4 @@ f'a={d["a"]}' ']' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_20b.txt b/tests/snippets/python/test_fstring_20b.txt index 556f7de8..fb3acc4f 100644 --- a/tests/snippets/python/test_fstring_20b.txt +++ b/tests/snippets/python/test_fstring_20b.txt @@ -14,4 +14,4 @@ f"a={d['a']}" ']' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_21a.txt b/tests/snippets/python/test_fstring_21a.txt index 1a591003..0107431d 100644 --- a/tests/snippets/python/test_fstring_21a.txt +++ b/tests/snippets/python/test_fstring_21a.txt @@ -12,4 +12,4 @@ f'a={d[a]}' ']' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_21b.txt b/tests/snippets/python/test_fstring_21b.txt index 7e3ed08a..f659d542 100644 --- a/tests/snippets/python/test_fstring_21b.txt +++ b/tests/snippets/python/test_fstring_21b.txt @@ -12,4 +12,4 @@ f"a={d[a]}" ']' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_22a.txt b/tests/snippets/python/test_fstring_22a.txt index 6a3b792f..a1066e92 100644 --- a/tests/snippets/python/test_fstring_22a.txt +++ b/tests/snippets/python/test_fstring_22a.txt @@ -11,4 +11,4 @@ fr'{header}:\s+' '\\' Literal.String.Single 's+' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_22b.txt b/tests/snippets/python/test_fstring_22b.txt index 75a08aac..79cb6b42 100644 --- a/tests/snippets/python/test_fstring_22b.txt +++ b/tests/snippets/python/test_fstring_22b.txt @@ -11,4 +11,4 @@ fr"{header}:\s+" '\\' Literal.String.Double 's+' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_23a.txt b/tests/snippets/python/test_fstring_23a.txt index ae944ed2..ef5cbd43 100644 --- a/tests/snippets/python/test_fstring_23a.txt +++ b/tests/snippets/python/test_fstring_23a.txt @@ -8,4 +8,4 @@ f'{a!r}' 'a' Name '!r}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_23b.txt b/tests/snippets/python/test_fstring_23b.txt index 8038c8b4..572fe04d 100644 --- a/tests/snippets/python/test_fstring_23b.txt +++ b/tests/snippets/python/test_fstring_23b.txt @@ -8,4 +8,4 @@ f"{a!r}" 'a' Name '!r}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_24a.txt b/tests/snippets/python/test_fstring_24a.txt index 9dd1e94e..d45385b8 100644 --- a/tests/snippets/python/test_fstring_24a.txt +++ b/tests/snippets/python/test_fstring_24a.txt @@ -7,10 +7,10 @@ f'{(lambda x: x*2)(3)}' '{' Literal.String.Interpol '(' Punctuation 'lambda' Keyword -' ' Text +' ' Text.Whitespace 'x' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'x' Name '*' Operator '2' Literal.Number.Integer @@ -20,4 +20,4 @@ f'{(lambda x: x*2)(3)}' ')' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_24b.txt b/tests/snippets/python/test_fstring_24b.txt index 0ef51a52..5e83b19e 100644 --- a/tests/snippets/python/test_fstring_24b.txt +++ b/tests/snippets/python/test_fstring_24b.txt @@ -7,10 +7,10 @@ f"{(lambda x: x*2)(3)}" '{' Literal.String.Interpol '(' Punctuation 'lambda' Keyword -' ' Text +' ' Text.Whitespace 'x' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'x' Name '*' Operator '2' Literal.Number.Integer @@ -20,4 +20,4 @@ f"{(lambda x: x*2)(3)}" ')' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_25a.txt b/tests/snippets/python/test_fstring_25a.txt index e42453e5..470db36d 100644 --- a/tests/snippets/python/test_fstring_25a.txt +++ b/tests/snippets/python/test_fstring_25a.txt @@ -21,4 +21,4 @@ extra = f'{extra},waiters:{len(self._waiters)}' ')' Punctuation '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_25b.txt b/tests/snippets/python/test_fstring_25b.txt index 2ba4b721..94893e51 100644 --- a/tests/snippets/python/test_fstring_25b.txt +++ b/tests/snippets/python/test_fstring_25b.txt @@ -21,4 +21,4 @@ extra = f"{extra},waiters:{len(self._waiters)}" ')' Punctuation '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_26a.txt b/tests/snippets/python/test_fstring_26a.txt index c644d447..01a231d3 100644 --- a/tests/snippets/python/test_fstring_26a.txt +++ b/tests/snippets/python/test_fstring_26a.txt @@ -17,4 +17,4 @@ message.append(f" [line {lineno:2d}]") ']' Literal.String.Double '"' Literal.String.Double ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_26b.txt b/tests/snippets/python/test_fstring_26b.txt index 73964104..a8131499 100644 --- a/tests/snippets/python/test_fstring_26b.txt +++ b/tests/snippets/python/test_fstring_26b.txt @@ -17,4 +17,4 @@ message.append(f' [line {lineno:2d}]') ']' Literal.String.Single "'" Literal.String.Single ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_27a.txt b/tests/snippets/python/test_fstring_27a.txt index cd8bdbe2..75af0c10 100644 --- a/tests/snippets/python/test_fstring_27a.txt +++ b/tests/snippets/python/test_fstring_27a.txt @@ -8,4 +8,4 @@ f"{foo=}" 'foo' Name '=}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_27b.txt b/tests/snippets/python/test_fstring_27b.txt index 7773ab30..71e6e510 100644 --- a/tests/snippets/python/test_fstring_27b.txt +++ b/tests/snippets/python/test_fstring_27b.txt @@ -8,4 +8,4 @@ f'{foo=}' 'foo' Name '=}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_28a.txt b/tests/snippets/python/test_fstring_28a.txt index 6aca3216..cdc65db2 100644 --- a/tests/snippets/python/test_fstring_28a.txt +++ b/tests/snippets/python/test_fstring_28a.txt @@ -8,4 +8,4 @@ f'{foo=!s}' 'foo' Name '=!s}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_28b.txt b/tests/snippets/python/test_fstring_28b.txt index 14183eba..99cf4f30 100644 --- a/tests/snippets/python/test_fstring_28b.txt +++ b/tests/snippets/python/test_fstring_28b.txt @@ -8,4 +8,4 @@ f"{foo=!s}" 'foo' Name '=!s}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_29a.txt b/tests/snippets/python/test_fstring_29a.txt index 81715064..2100b3b8 100644 --- a/tests/snippets/python/test_fstring_29a.txt +++ b/tests/snippets/python/test_fstring_29a.txt @@ -12,4 +12,4 @@ f"{math.pi=!f:.2f}" '.2f' Literal.String.Double '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_29b.txt b/tests/snippets/python/test_fstring_29b.txt index de5b5083..4cc18dd0 100644 --- a/tests/snippets/python/test_fstring_29b.txt +++ b/tests/snippets/python/test_fstring_29b.txt @@ -12,4 +12,4 @@ f'{math.pi=!f:.2f}' '.2f' Literal.String.Single '}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_30a.txt b/tests/snippets/python/test_fstring_30a.txt index f295cfe4..3db443e1 100644 --- a/tests/snippets/python/test_fstring_30a.txt +++ b/tests/snippets/python/test_fstring_30a.txt @@ -5,12 +5,12 @@ f"{ chr(65) =}" 'f' Literal.String.Affix '"' Literal.String.Double '{' Literal.String.Interpol -' ' Text +' ' Text.Whitespace 'chr' Name.Builtin '(' Punctuation '65' Literal.Number.Integer ')' Punctuation -' ' Text +' ' Text.Whitespace '=}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_30b.txt b/tests/snippets/python/test_fstring_30b.txt index 10a2af8e..5f082e53 100644 --- a/tests/snippets/python/test_fstring_30b.txt +++ b/tests/snippets/python/test_fstring_30b.txt @@ -5,12 +5,12 @@ f'{ chr(65) =}' 'f' Literal.String.Affix "'" Literal.String.Single '{' Literal.String.Interpol -' ' Text +' ' Text.Whitespace 'chr' Name.Builtin '(' Punctuation '65' Literal.Number.Integer ')' Punctuation -' ' Text +' ' Text.Whitespace '=}' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_31a.txt b/tests/snippets/python/test_fstring_31a.txt index eac01679..3e9c091a 100644 --- a/tests/snippets/python/test_fstring_31a.txt +++ b/tests/snippets/python/test_fstring_31a.txt @@ -9,7 +9,7 @@ f"{chr(65) = }" '(' Punctuation '65' Literal.Number.Integer ')' Punctuation -' ' Text +' ' Text.Whitespace '= }' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_31b.txt b/tests/snippets/python/test_fstring_31b.txt index 40702daa..37adb3ef 100644 --- a/tests/snippets/python/test_fstring_31b.txt +++ b/tests/snippets/python/test_fstring_31b.txt @@ -9,7 +9,7 @@ f'{chr(65) = }' '(' Punctuation '65' Literal.Number.Integer ')' Punctuation -' ' Text +' ' Text.Whitespace '= }' Literal.String.Interpol "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_32a.txt b/tests/snippets/python/test_fstring_32a.txt index 666134c6..dcfc39d1 100644 --- a/tests/snippets/python/test_fstring_32a.txt +++ b/tests/snippets/python/test_fstring_32a.txt @@ -12,4 +12,4 @@ f'*{n=:30}*' '}' Literal.String.Interpol '*' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_32b.txt b/tests/snippets/python/test_fstring_32b.txt index 9e087252..1f8a4509 100644 --- a/tests/snippets/python/test_fstring_32b.txt +++ b/tests/snippets/python/test_fstring_32b.txt @@ -12,4 +12,4 @@ f"*{n=:30}*" '}' Literal.String.Interpol '*' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_33a.txt b/tests/snippets/python/test_fstring_33a.txt index 232491b2..5318b552 100644 --- a/tests/snippets/python/test_fstring_33a.txt +++ b/tests/snippets/python/test_fstring_33a.txt @@ -12,4 +12,4 @@ f'*{n=!r:30}*' '}' Literal.String.Interpol '*' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_33b.txt b/tests/snippets/python/test_fstring_33b.txt index 1481e811..a0211ddb 100644 --- a/tests/snippets/python/test_fstring_33b.txt +++ b/tests/snippets/python/test_fstring_33b.txt @@ -12,4 +12,4 @@ f"*{n=!r:30}*" '}' Literal.String.Interpol '*' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_34a.txt b/tests/snippets/python/test_fstring_34a.txt index 6bd510a9..9b80cc9c 100644 --- a/tests/snippets/python/test_fstring_34a.txt +++ b/tests/snippets/python/test_fstring_34a.txt @@ -17,4 +17,4 @@ f"*{f'{n=}':30}*" '}' Literal.String.Interpol '*' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_34b.txt b/tests/snippets/python/test_fstring_34b.txt index 4cb7e631..5abf37f0 100644 --- a/tests/snippets/python/test_fstring_34b.txt +++ b/tests/snippets/python/test_fstring_34b.txt @@ -17,4 +17,4 @@ f'*{f"{n=}":30}*' '}' Literal.String.Interpol '*' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_35a.txt b/tests/snippets/python/test_fstring_35a.txt index f09edc18..b4e10417 100644 --- a/tests/snippets/python/test_fstring_35a.txt +++ b/tests/snippets/python/test_fstring_35a.txt @@ -12,4 +12,4 @@ f'*{n=:+<30}*' '}' Literal.String.Interpol '*' Literal.String.Single "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_35b.txt b/tests/snippets/python/test_fstring_35b.txt index 794f7b69..773e7a40 100644 --- a/tests/snippets/python/test_fstring_35b.txt +++ b/tests/snippets/python/test_fstring_35b.txt @@ -12,4 +12,4 @@ f"*{n=:+<30}*" '}' Literal.String.Interpol '*' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_36a.txt b/tests/snippets/python/test_fstring_36a.txt index 4b6ab230..773e38e6 100644 --- a/tests/snippets/python/test_fstring_36a.txt +++ b/tests/snippets/python/test_fstring_36a.txt @@ -8,9 +8,9 @@ f'''{foo "'''" Literal.String.Single '{' Literal.String.Interpol 'foo' Name -'\n ' Text +'\n ' Text.Whitespace '= !s:' Literal.String.Interpol '20' Literal.String.Single '}' Literal.String.Interpol "'''" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_fstring_36b.txt b/tests/snippets/python/test_fstring_36b.txt index abc9cf3e..da79ce21 100644 --- a/tests/snippets/python/test_fstring_36b.txt +++ b/tests/snippets/python/test_fstring_36b.txt @@ -8,9 +8,9 @@ f"""{foo '"""' Literal.String.Double '{' Literal.String.Interpol 'foo' Name -'\n ' Text +'\n ' Text.Whitespace '= !s:' Literal.String.Interpol '20' Literal.String.Double '}' Literal.String.Interpol '"""' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_needs_name.txt b/tests/snippets/python/test_needs_name.txt index 60c782c5..f121da03 100644 --- a/tests/snippets/python/test_needs_name.txt +++ b/tests/snippets/python/test_needs_name.txt @@ -52,4 +52,4 @@ S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) ' ' Text 'r' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_pep_515.txt b/tests/snippets/python/test_pep_515.txt index a5f2f358..38fa6195 100644 --- a/tests/snippets/python/test_pep_515.txt +++ b/tests/snippets/python/test_pep_515.txt @@ -10,19 +10,19 @@ ---tokens--- '1_000_000' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace '1_000.000_001' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1_000e1_000j' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '0xCAFE_F00D' Literal.Number.Hex -'\n' Text +'\n' Text.Whitespace '0b_0011_1111_0100_1110' Literal.Number.Bin -'\n' Text +'\n' Text.Whitespace '0o_777_123' Literal.Number.Oct -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_raw_fstring.txt b/tests/snippets/python/test_raw_fstring.txt index 0dd51c1e..33810881 100644 --- a/tests/snippets/python/test_raw_fstring.txt +++ b/tests/snippets/python/test_raw_fstring.txt @@ -14,9 +14,9 @@ rf"m_{{\nu}} = {x}" '\\' Literal.String.Double 'nu = x' Literal.String.Double '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'f' Literal.String.Affix '"' Literal.String.Double @@ -27,9 +27,9 @@ rf"m_{{\nu}} = {x}" 'x' Name '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'rf' Literal.String.Affix '"' Literal.String.Double @@ -43,4 +43,4 @@ rf"m_{{\nu}} = {x}" 'x' Name '}' Literal.String.Interpol '"' Literal.String.Double -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_string_escape_codes.txt b/tests/snippets/python/test_string_escape_codes.txt index 5b06329c..c02dc037 100644 --- a/tests/snippets/python/test_string_escape_codes.txt +++ b/tests/snippets/python/test_string_escape_codes.txt @@ -17,4 +17,4 @@ ' ' Literal.String.Single '\\N{Plus-Minus Sign}' Literal.String.Escape "'" Literal.String.Single -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/python/test_walrus_operator.txt b/tests/snippets/python/test_walrus_operator.txt index 05935ec9..9bab89dc 100644 --- a/tests/snippets/python/test_walrus_operator.txt +++ b/tests/snippets/python/test_walrus_operator.txt @@ -18,4 +18,4 @@ if (a := 2) > 4: ' ' Text '4' Literal.Number.Integer ':' Punctuation -'\n' Text +'\n' Text.Whitespace |