Fixing formatting

This commit is contained in:
samstrohkorbatt 2024-04-01 14:42:16 -06:00 committed by Aiday Marlen Kyzy
parent 5c2fa6430a
commit 7f2dfa1b8b
No known key found for this signature in database
GPG key ID: 24A8B53DBD26FF4E
2 changed files with 21 additions and 21 deletions

View file

@ -196,11 +196,11 @@ testTokenization('python', [
{ {
line: 'f"str {var} str"', line: 'f"str {var} str"',
tokens: [ tokens: [
{startIndex: 0, type: 'string.escape.python'}, { startIndex: 0, type: 'string.escape.python' },
{startIndex: 2, type: 'string.python'}, { startIndex: 2, type: 'string.python' },
{startIndex: 6, type: 'identifier.python'}, { startIndex: 6, type: 'identifier.python' },
{startIndex: 11, type: 'string.python'}, { startIndex: 11, type: 'string.python' },
{startIndex: 15, type: 'string.escape.python'} { startIndex: 15, type: 'string.escape.python' }
] ]
} }
], ],
@ -208,11 +208,11 @@ testTokenization('python', [
{ {
line: `f'''str {var} str'''`, line: `f'''str {var} str'''`,
tokens: [ tokens: [
{startIndex: 0, type: 'string.escape.python'}, { startIndex: 0, type: 'string.escape.python' },
{startIndex: 4, type: 'string.python'}, { startIndex: 4, type: 'string.python' },
{startIndex: 8, type: 'identifier.python'}, { startIndex: 8, type: 'identifier.python' },
{startIndex: 13, type: 'string.python'}, { startIndex: 13, type: 'string.python' },
{startIndex: 17, type: 'string.escape.python'} { startIndex: 17, type: 'string.escape.python' }
] ]
} }
], ],
@ -220,15 +220,15 @@ testTokenization('python', [
{ {
line: 'f"{var:.3f}{var!r}{var=}"', line: 'f"{var:.3f}{var!r}{var=}"',
tokens: [ tokens: [
{startIndex: 0, type: 'string.escape.python'}, { startIndex: 0, type: 'string.escape.python' },
{startIndex: 2, type: 'identifier.python'}, { startIndex: 2, type: 'identifier.python' },
{startIndex: 6, type: 'string.python'}, { startIndex: 6, type: 'string.python' },
{startIndex: 10, type: 'identifier.python'}, { startIndex: 10, type: 'identifier.python' },
{startIndex: 15, type: 'string.python'}, { startIndex: 15, type: 'string.python' },
{startIndex: 17, type: 'identifier.python'}, { startIndex: 17, type: 'identifier.python' },
{startIndex: 22, type: 'string.python'}, { startIndex: 22, type: 'string.python' },
{startIndex: 23, type: 'identifier.python'}, { startIndex: 23, type: 'identifier.python' },
{startIndex: 24, type: 'string.escape.python'} { startIndex: 24, type: 'string.escape.python' }
] ]
} }
], ],
@ -253,5 +253,5 @@ testTokenization('python', [
{ startIndex: 6, type: 'string.escape.python' } { startIndex: 6, type: 'string.escape.python' }
] ]
} }
], ]
]); ]);

View file

@ -288,7 +288,7 @@ export const language = <languages.IMonarchLanguage>{
], ],
fStringDetail: [ fStringDetail: [
[/[:][^}]+/, 'string'], [/[:][^}]+/, 'string'],
[/[!][ars]/, 'string'], // only !a, !r, !s are supported by f-strings: https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals [/[!][ars]/, 'string'], // only !a, !r, !s are supported by f-strings: https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals
[/=/, 'string'], [/=/, 'string'],
[/\}/, 'identifier', '@pop'] [/\}/, 'identifier', '@pop']
] ]