Skip to content

Commit e23a111

Browse files
committed
Fixing issues regarding fstring
previously dictionaries inside the curly brackets could cause issues, we now parse everything inside f strings as text including newlines
1 parent 1f6f221 commit e23a111

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎src/main/grammars/de/monticore/Python.mc4‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ grammar Python extends MultilineString, // Must be first to avoid conflicts wit
7979
= (StringFDQCharacterPython)+;
8080

8181
fragment token StringFSQCharacterPython
82-
= ~ ('\''| '\\'| '{' )| PythonEscapeSequence |InnerFString;
82+
= ~ ('\''| '\\')| PythonEscapeSequence;
8383
fragment token StringFDQCharacterPython
84-
= ~ ('"'| '\\'| '{') | PythonEscapeSequence |InnerFString;
85-
fragment token InnerFString = '{' ~('}')* '}';
84+
= ~ ('"'| '\\') | PythonEscapeSequence;
8685

8786
// === number tokens for python ===
8887

0 commit comments

Comments
 (0)