Format implicit string continuation (#5328)

This commit is contained in:
Micha Reiser 2023-06-26 14:41:47 +02:00 committed by GitHub
parent 313711aaf9
commit 49cabca3e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 443 additions and 60 deletions

View file

@ -66,6 +66,54 @@ String '"""
'''Multiline
String \"\"\"
'''
# String continuation
"Let's" "start" "with" "a" "simple" "example"
"Let's" "start" "with" "a" "simple" "example" "now repeat after me:" "I am confident" "I am confident" "I am confident" "I am confident" "I am confident"
(
"Let's" "start" "with" "a" "simple" "example" "now repeat after me:" "I am confident" "I am confident" "I am confident" "I am confident" "I am confident"
)
if (
a + "Let's"
"start"
"with"
"a"
"simple"
"example"
"now repeat after me:"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
):
pass
if "Let's" "start" "with" "a" "simple" "example" "now repeat after me:" "I am confident" "I am confident" "I am confident" "I am confident" "I am confident":
pass
(
# leading
"a" # trailing part commen
# leading part comment
"b" # trailing second part comment
# trailing
)
test_particular = [
# squares
'1.00000000100000000025',
'1.0000000000000000000000000100000000000000000000000' #...
'00025',
'1.0000000000000000000000000000000000000000000010000' #...
'0000000000000000000000000000000000000000025',
]
```
## Outputs
@ -140,6 +188,77 @@ String '"""
"""Multiline
String \"\"\"
"""
# String continuation
"Let's" "start" "with" "a" "simple" "example"
"Let's" "start" "with" "a" "simple" "example" "now repeat after me:" "I am confident" "I am confident" "I am confident" "I am confident" "I am confident"
(
"Let's"
"start"
"with"
"a"
"simple"
"example"
"now repeat after me:"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
)
if (
a
+ "Let's"
"start"
"with"
"a"
"simple"
"example"
"now repeat after me:"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
):
pass
if (
"Let's"
"start"
"with"
"a"
"simple"
"example"
"now repeat after me:"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
"I am confident"
):
pass
(
# leading
"a" # trailing part commen
# leading part comment
"b" # trailing second part comment
# trailing
)
test_particular = [
# squares
"1.00000000100000000025",
"1.0000000000000000000000000100000000000000000000000" # ...
"00025",
"1.0000000000000000000000000000000000000000000010000" # ...
"0000000000000000000000000000000000000000025",
]
```
@ -214,6 +333,77 @@ String '"""
'''Multiline
String \"\"\"
'''
# String continuation
"Let's" 'start' 'with' 'a' 'simple' 'example'
"Let's" 'start' 'with' 'a' 'simple' 'example' 'now repeat after me:' 'I am confident' 'I am confident' 'I am confident' 'I am confident' 'I am confident'
(
"Let's"
'start'
'with'
'a'
'simple'
'example'
'now repeat after me:'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
)
if (
a
+ "Let's"
'start'
'with'
'a'
'simple'
'example'
'now repeat after me:'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
):
pass
if (
"Let's"
'start'
'with'
'a'
'simple'
'example'
'now repeat after me:'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
'I am confident'
):
pass
(
# leading
'a' # trailing part commen
# leading part comment
'b' # trailing second part comment
# trailing
)
test_particular = [
# squares
'1.00000000100000000025',
'1.0000000000000000000000000100000000000000000000000' # ...
'00025',
'1.0000000000000000000000000000000000000000000010000' # ...
'0000000000000000000000000000000000000000025',
]
```