GeezerVison is showing github.com — Make raw f-strings consistent. · MagicStack/MagicPython@507e769
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: grammars/MagicPython.cson +2-908Lines changed: 2 additions & 908 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: grammars/MagicPython.tmLanguage +2-1,786Lines changed: 2 additions & 1786 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: grammars/src/MagicPython.syntax.yaml -80Lines changed: 0 additions & 80 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -103,82 +103,6 @@ repository: | 103 | 103 | bquote: '(""")' | 104 | 104 | equote: '(""")' | 105 | 105 |
| 106 | | - - file: 'regexp.inc.syntax.yaml' | 107 | | - vars: | 108 | | - prefix: 'single-one-' | 109 | | - basename: 'fregexp' | 110 | | - marker: "|(?=\\')" | 111 | | - nested: '' | 112 | | - guard: "|((?=(?<!\\\\)\\n))" | 113 | | - | 114 | | - - file: 'regexp.inc.syntax.yaml' | 115 | | - vars: | 116 | | - prefix: 'single-three-' | 117 | | - basename: 'fregexp' | 118 | | - marker: "|(?=\\'\\'\\')" | 119 | | - nested: "- include: '#comments-string-single-three'" | 120 | | - guard: "" | 121 | | - | 122 | | - - file: 'regexp.inc.syntax.yaml' | 123 | | - vars: | 124 | | - prefix: 'double-one-' | 125 | | - basename: 'fregexp' | 126 | | - marker: '|(?=")' | 127 | | - nested: '' | 128 | | - guard: "|((?=(?<!\\\\)\\n))" | 129 | | - | 130 | | - - file: 'regexp.inc.syntax.yaml' | 131 | | - vars: | 132 | | - prefix: 'double-three-' | 133 | | - basename: 'fregexp' | 134 | | - marker: '|(?=""")' | 135 | | - nested: "- include: '#comments-string-double-three'" | 136 | | - guard: "" | 137 | | - | 138 | | - - file: 'regexp.wrapper.syntax.yaml' | 139 | | - vars: | 140 | | - scopename: string.regexp.quoted.single.python | 141 | | - string.interpolated.python | 142 | | - prefix: 'single-one-' | 143 | | - basename: 'fregexp' | 144 | | - nested: '' | 145 | | - modifier: '[fF]' | 146 | | - bquote: "(\\')" | 147 | | - equote: "(\\')|(?<!\\\\)(\\n)" | 148 | | - | 149 | | - - file: 'regexp.wrapper.syntax.yaml' | 150 | | - vars: | 151 | | - scopename: string.regexp.quoted.multi.python | 152 | | - string.interpolated.python | 153 | | - prefix: 'single-three-' | 154 | | - basename: 'fregexp' | 155 | | - nested: "- include: '#comments-string-single-three'" | 156 | | - modifier: '[fF]' | 157 | | - bquote: "(\\'\\'\\')" | 158 | | - equote: "(\\'\\'\\')" | 159 | | - | 160 | | - - file: 'regexp.wrapper.syntax.yaml' | 161 | | - vars: | 162 | | - scopename: string.regexp.quoted.single.python | 163 | | - string.interpolated.python | 164 | | - prefix: 'double-one-' | 165 | | - basename: 'fregexp' | 166 | | - nested: '' | 167 | | - modifier: '[fF]' | 168 | | - bquote: '(")' | 169 | | - equote: '(")|(?<!\\)(\n)' | 170 | | - | 171 | | - - file: 'regexp.wrapper.syntax.yaml' | 172 | | - vars: | 173 | | - scopename: string.regexp.quoted.multi.python | 174 | | - string.interpolated.python | 175 | | - prefix: 'double-three-' | 176 | | - basename: 'fregexp' | 177 | | - nested: "- include: '#comments-string-double-three'" | 178 | | - modifier: '[fF]' | 179 | | - bquote: '(""")' | 180 | | - equote: '(""")' | 181 | | - | 182 | 106 | - file: 'pystring.inc.syntax.yaml' | 183 | 107 | vars: | 184 | 108 | line: single | @@ -700,10 +624,6 @@ repository: | 700 | 624 | - include: '#regexp-double-three-line' | 701 | 625 | - include: '#regexp-single-one-line' | 702 | 626 | - include: '#regexp-double-one-line' | 703 | | - - include: '#fregexp-single-three-line' | 704 | | - - include: '#fregexp-double-three-line' | 705 | | - - include: '#fregexp-single-one-line' | 706 | | - - include: '#fregexp-double-one-line' | 707 | 627 |
| 708 | 628 | string: | 709 | 629 | patterns: | |
Collapse file Copy file name to clipboardExpand all lines: grammars/src/pyfstring.inc.syntax.yaml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,7 @@ fstring-normf-quoted-${line}-line: | 51 | 51 |
| 52 | 52 | fstring-raw-quoted-${line}-line: | 53 | 53 | name: meta.fstring.python | 54 | | - begin: (\b(?:[R][fF]|[fF][R]))(${marker}) | | 54 | + begin: (\b(?:[rR][fF]|[fF][rR]))(${marker}) | 55 | 55 | end: (\2)${guard} | 56 | 56 | beginCaptures: | 57 | 57 | '1': {name: storage.type.string.python | |
Collapse file Copy file name to clipboardExpand all lines: misc/example.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,6 +22,8 @@ async def coroutine(db:aio_db.DatabaseConnection) -> List[str]: | 22 | 22 | async with db.transaction(): | 23 | 23 | result = await db.query(...) | 24 | 24 | print(f'Result: {result!r} {a=} {b=!r}') | | 25 | + print(Rf'data: {c=}') | | 26 | + print(rf'data: {c=}') | 25 | 27 |
| 26 | 28 | mapping = None # type: Dict[int, Any] # PEP 484 | 27 | 29 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/atom-spec/python-spec.js +335-409Lines changed: 335 additions & 409 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: test/fstrings/empty2.py +19-17Lines changed: 19 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 | | -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python | 11 | | -" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 12 | | -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 13 | | -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 14 | | - : source.python, string.interpolated.python, string.regexp.quoted.single.python | 15 | | -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 16 | | - : invalid.illegal.brace.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 17 | | -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 18 | | -" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python | 19 | | -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python | 20 | | -""" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 21 | | -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 22 | | -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 23 | | -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 24 | | - : invalid.illegal.brace.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 25 | | -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | 26 | | -""" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python | | 10 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 11 | +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 12 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 13 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 14 | + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 15 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 16 | + : invalid.illegal.brace.python, meta.fstring.python, source.python | | 17 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 18 | +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 19 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python | | 20 | +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python | | 21 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 22 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 23 | + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 24 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 25 | + : invalid.illegal.brace.python, meta.fstring.python, source.python | | 26 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 27 | + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 28 | +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python |
Collapse file Copy file name to clipboard +40Lines changed: 40 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +a = fr'[a-z]' | | 2 | +a = Fr'[a-z]' | | 3 | +a = rf'[a-z]' | | 4 | +a = rF'[a-z]' | | 5 | + | | 6 | + | | 7 | + | | 8 | + | | 9 | +a : source.python | | 10 | + : source.python | | 11 | += : keyword.operator.assignment.python, source.python | | 12 | + : source.python | | 13 | +fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 14 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 15 | +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 16 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 17 | +a : source.python | | 18 | + : source.python | | 19 | += : keyword.operator.assignment.python, source.python | | 20 | + : source.python | | 21 | +Fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 22 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 23 | +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 24 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 25 | +a : source.python | | 26 | + : source.python | | 27 | += : keyword.operator.assignment.python, source.python | | 28 | + : source.python | | 29 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 30 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 31 | +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 32 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 33 | +a : source.python | | 34 | + : source.python | | 35 | += : keyword.operator.assignment.python, source.python | | 36 | + : source.python | | 37 | +rF : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 38 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 39 | +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 40 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python |
Collapse file Copy file name to clipboard +36Lines changed: 36 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +rf'fo{{2}}' | | 2 | +rf"fo{{2}}" | | 3 | +rf'''fo{{2}}''' | | 4 | +rf"""fo{{2}}""" | | 5 | + | | 6 | + | | 7 | + | | 8 | + | | 9 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 10 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 11 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 12 | +{{ : constant.character.escape.python, meta.fstring.python, source.python | | 13 | +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 14 | +}} : constant.character.escape.python, meta.fstring.python, source.python | | 15 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 16 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 17 | +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 18 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 19 | +{{ : constant.character.escape.python, meta.fstring.python, source.python | | 20 | +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 21 | +}} : constant.character.escape.python, meta.fstring.python, source.python | | 22 | +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 23 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python | | 24 | +''' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python | | 25 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 26 | +{{ : constant.character.escape.python, meta.fstring.python, source.python | | 27 | +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 28 | +}} : constant.character.escape.python, meta.fstring.python, source.python | | 29 | +''' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 30 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python | | 31 | +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python | | 32 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 33 | +{{ : constant.character.escape.python, meta.fstring.python, source.python | | 34 | +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 35 | +}} : constant.character.escape.python, meta.fstring.python, source.python | | 36 | +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python |
Collapse file Copy file name to clipboard +36Lines changed: 36 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +rf'fo{2}' | | 2 | +rf"fo{2}" | | 3 | +rf'''fo{2}''' | | 4 | +rf"""fo{2}""" | | 5 | + | | 6 | + | | 7 | + | | 8 | + | | 9 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 10 | +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 11 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 12 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 13 | +2 : constant.numeric.dec.python, meta.fstring.python, source.python | | 14 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 15 | +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 16 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python | | 17 | +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python | | 18 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 19 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 20 | +2 : constant.numeric.dec.python, meta.fstring.python, source.python | | 21 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 22 | +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python | | 23 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python | | 24 | +''' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python | | 25 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 26 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 27 | +2 : constant.numeric.dec.python, meta.fstring.python, source.python | | 28 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 29 | +''' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 30 | +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python | | 31 | +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python | | 32 | +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python | | 33 | +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 34 | +2 : constant.numeric.dec.python, meta.fstring.python, source.python | | 35 | +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python | | 36 | +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python |
|