| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1f7c61b commit a71b792
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,6 +113,7 @@ repository: | |||
| 113 | 113 | '1': {name: punctuation.definition.string.end.python} | |
| 114 | 114 | patterns: | |
| 115 | 115 | - include: '#docstring-guts-unicode' | |
| 116 | + - include: '#docstring-guts-common-single' | ||
| 116 | 117 | ||
| 117 | 118 | - name: string.quoted.docstring.raw.python | |
| 118 | 119 | begin: ([rR])(\'\'\') | |
@@ -124,6 +125,7 @@ repository: | |||
| 124 | 125 | '1': {name: punctuation.definition.string.end.python} | |
| 125 | 126 | patterns: | |
| 126 | 127 | - include: '#docstring-guts-raw' | |
| 128 | + - include: '#docstring-guts-common-single' | ||
| 127 | 129 | ||
| 128 | 130 | - name: string.quoted.docstring.python | |
| 129 | 131 | begin: (\"\"\") | |
@@ -134,6 +136,7 @@ repository: | |||
| 134 | 136 | '1': {name: punctuation.definition.string.end.python} | |
| 135 | 137 | patterns: | |
| 136 | 138 | - include: '#docstring-guts-unicode' | |
| 139 | + - include: '#docstring-guts-common-double' | ||
| 137 | 140 | ||
| 138 | 141 | - name: string.quoted.docstring.raw.python | |
| 139 | 142 | begin: ([rR])(\"\"\") | |
@@ -145,23 +148,29 @@ repository: | |||
| 145 | 148 | '1': {name: punctuation.definition.string.end.python} | |
| 146 | 149 | patterns: | |
| 147 | 150 | - include: '#docstring-guts-raw' | |
| 151 | + - include: '#docstring-guts-common-double' | ||
| 148 | 152 | ||
| 149 | 153 | docstring-guts-unicode: | |
| 150 | 154 | patterns: | |
| 151 | 155 | - include: '#escape-sequence-unicode' | |
| 152 | 156 | - include: '#escape-sequence' | |
| 153 | 157 | - include: '#string-line-continuation' | |
| 154 | - - include: '#docstring-guts-common' | ||
| 155 | 158 | ||
| 156 | 159 | docstring-guts-raw: | |
| 157 | 160 | patterns: | |
| 158 | 161 | - include: '#escape-sequence' | |
| 159 | 162 | - include: '#string-line-continuation' | |
| 160 | - - include: '#docstring-guts-common' | ||
| 161 | 163 | ||
| 162 | - docstring-guts-common: | ||
| 164 | + docstring-guts-common-single: | ||
| 163 | 165 | begin: (>>>|\.\.\.) | |
| 164 | - end: $ | ||
| 166 | + end: ($|(?=\'\'\')) | ||
| 167 | + patterns: | ||
| 168 | + - include: '#statement' | ||
| 169 | + - include: '#expression' | ||
| 170 | + | ||
| 171 | + docstring-guts-common-double: | ||
| 172 | + begin: (>>>|\.\.\.) | ||
| 173 | + end: ($|(?=\"\"\")) | ||
| 165 | 174 | patterns: | |
| 166 | 175 | - include: '#statement' | |
| 167 | 176 | - include: '#expression' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,6 +99,9 @@ repository: | |||
| 99 | 99 | { | |
| 100 | 100 | include: "#docstring-guts-unicode" | |
| 101 | 101 | } | |
| 102 | + { | ||
| 103 | + include: "#docstring-guts-common-single" | ||
| 104 | + } | ||
| 102 | 105 | ] | |
| 103 | 106 | } | |
| 104 | 107 | { | |
@@ -117,6 +120,9 @@ repository: | |||
| 117 | 120 | { | |
| 118 | 121 | include: "#docstring-guts-raw" | |
| 119 | 122 | } | |
| 123 | + { | ||
| 124 | + include: "#docstring-guts-common-single" | ||
| 125 | + } | ||
| 120 | 126 | ] | |
| 121 | 127 | } | |
| 122 | 128 | { | |
@@ -133,6 +139,9 @@ repository: | |||
| 133 | 139 | { | |
| 134 | 140 | include: "#docstring-guts-unicode" | |
| 135 | 141 | } | |
| 142 | + { | ||
| 143 | + include: "#docstring-guts-common-double" | ||
| 144 | + } | ||
| 136 | 145 | ] | |
| 137 | 146 | } | |
| 138 | 147 | { | |
@@ -151,6 +160,9 @@ repository: | |||
| 151 | 160 | { | |
| 152 | 161 | include: "#docstring-guts-raw" | |
| 153 | 162 | } | |
| 163 | + { | ||
| 164 | + include: "#docstring-guts-common-double" | ||
| 165 | + } | ||
| 154 | 166 | ] | |
| 155 | 167 | } | |
| 156 | 168 | ] | |
@@ -165,9 +177,6 @@ repository: | |||
| 165 | 177 | { | |
| 166 | 178 | include: "#string-line-continuation" | |
| 167 | 179 | } | |
| 168 | - { | ||
| 169 | - include: "#docstring-guts-common" | ||
| 170 | - } | ||
| 171 | 180 | ] | |
| 172 | 181 | "docstring-guts-raw": | |
| 173 | 182 | patterns: [ | |
@@ -177,13 +186,21 @@ repository: | |||
| 177 | 186 | { | |
| 178 | 187 | include: "#string-line-continuation" | |
| 179 | 188 | } | |
| 189 | + ] | ||
| 190 | + "docstring-guts-common-single": | ||
| 191 | + begin: "(>>>|\\.\\.\\.)" | ||
| 192 | + end: "($|(?=\\'\\'\\'))" | ||
| 193 | + patterns: [ | ||
| 194 | + { | ||
| 195 | + include: "#statement" | ||
| 196 | + } | ||
| 180 | 197 | { | |
| 181 | - include: "#docstring-guts-common" | ||
| 198 | + include: "#expression" | ||
| 182 | 199 | } | |
| 183 | 200 | ] | |
| 184 | - "docstring-guts-common": | ||
| 201 | + "docstring-guts-common-double": | ||
| 185 | 202 | begin: "(>>>|\\.\\.\\.)" | |
| 186 | - end: "$" | ||
| 203 | + end: "($|(?=\\\"\\\"\\\"))" | ||
| 187 | 204 | patterns: [ | |
| 188 | 205 | { | |
| 189 | 206 | include: "#statement" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,6 +167,10 @@ | |||
| 167 | 167 | <key>include</key> | |
| 168 | 168 | <string>#docstring-guts-unicode</string> | |
| 169 | 169 | </dict> | |
| 170 | + <dict> | ||
| 171 | + <key>include</key> | ||
| 172 | + <string>#docstring-guts-common-single</string> | ||
| 173 | + </dict> | ||
| 170 | 174 | </array> | |
| 171 | 175 | </dict> | |
| 172 | 176 | <dict> | |
@@ -203,6 +207,10 @@ | |||
| 203 | 207 | <key>include</key> | |
| 204 | 208 | <string>#docstring-guts-raw</string> | |
| 205 | 209 | </dict> | |
| 210 | + <dict> | ||
| 211 | + <key>include</key> | ||
| 212 | + <string>#docstring-guts-common-single</string> | ||
| 213 | + </dict> | ||
| 206 | 214 | </array> | |
| 207 | 215 | </dict> | |
| 208 | 216 | <dict> | |
@@ -234,6 +242,10 @@ | |||
| 234 | 242 | <key>include</key> | |
| 235 | 243 | <string>#docstring-guts-unicode</string> | |
| 236 | 244 | </dict> | |
| 245 | + <dict> | ||
| 246 | + <key>include</key> | ||
| 247 | + <string>#docstring-guts-common-double</string> | ||
| 248 | + </dict> | ||
| 237 | 249 | </array> | |
| 238 | 250 | </dict> | |
| 239 | 251 | <dict> | |
@@ -270,6 +282,10 @@ | |||
| 270 | 282 | <key>include</key> | |
| 271 | 283 | <string>#docstring-guts-raw</string> | |
| 272 | 284 | </dict> | |
| 285 | + <dict> | ||
| 286 | + <key>include</key> | ||
| 287 | + <string>#docstring-guts-common-double</string> | ||
| 288 | + </dict> | ||
| 273 | 289 | </array> | |
| 274 | 290 | </dict> | |
| 275 | 291 | </array> | |
@@ -290,10 +306,6 @@ | |||
| 290 | 306 | <key>include</key> | |
| 291 | 307 | <string>#string-line-continuation</string> | |
| 292 | 308 | </dict> | |
| 293 | - <dict> | ||
| 294 | - <key>include</key> | ||
| 295 | - <string>#docstring-guts-common</string> | ||
| 296 | - </dict> | ||
| 297 | 309 | </array> | |
| 298 | 310 | </dict> | |
| 299 | 311 | <key>docstring-guts-raw</key> | |
@@ -308,18 +320,32 @@ | |||
| 308 | 320 | <key>include</key> | |
| 309 | 321 | <string>#string-line-continuation</string> | |
| 310 | 322 | </dict> | |
| 323 | + </array> | ||
| 324 | + </dict> | ||
| 325 | + <key>docstring-guts-common-single</key> | ||
| 326 | + <dict> | ||
| 327 | + <key>begin</key> | ||
| 328 | + <string>(>>>|\.\.\.)</string> | ||
| 329 | + <key>end</key> | ||
| 330 | + <string>($|(?=\'\'\'))</string> | ||
| 331 | + <key>patterns</key> | ||
| 332 | + <array> | ||
| 333 | + <dict> | ||
| 334 | + <key>include</key> | ||
| 335 | + <string>#statement</string> | ||
| 336 | + </dict> | ||
| 311 | 337 | <dict> | |
| 312 | 338 | <key>include</key> | |
| 313 | - <string>#docstring-guts-common</string> | ||
| 339 | + <string>#expression</string> | ||
| 314 | 340 | </dict> | |
| 315 | 341 | </array> | |
| 316 | 342 | </dict> | |
| 317 | - <key>docstring-guts-common</key> | ||
| 343 | + <key>docstring-guts-common-double</key> | ||
| 318 | 344 | <dict> | |
| 319 | 345 | <key>begin</key> | |
| 320 | 346 | <string>(>>>|\.\.\.)</string> | |
| 321 | 347 | <key>end</key> | |
| 322 | - <string>$</string> | ||
| 348 | + <string>($|(?=\"\"\"))</string> | ||
| 323 | 349 | <key>patterns</key> | |
| 324 | 350 | <array> | |
| 325 | 351 | <dict> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + '''>>> print("""docstring""")''' | ||
| 2 | + """>>> print('''docstring''')""" | ||
| 3 | + | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | + ''' : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python | ||
| 8 | + >>> : source.python, string.quoted.docstring.python | ||
| 9 | + : source.python, string.quoted.docstring.python | ||
| 10 | + print : meta.function-call.python, source.python, string.quoted.docstring.python, support.function.builtin.python | ||
| 11 | + ( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python, string.quoted.docstring.python | ||
| 12 | + """ : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 13 | + docstring : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 14 | + """ : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 15 | + ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python, string.quoted.docstring.python | ||
| 16 | + ''' : punctuation.definition.string.end.python, source.python, string.quoted.docstring.python | ||
| 17 | + """ : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python | ||
| 18 | + >>> : source.python, string.quoted.docstring.python | ||
| 19 | + : source.python, string.quoted.docstring.python | ||
| 20 | + print : meta.function-call.python, source.python, string.quoted.docstring.python, support.function.builtin.python | ||
| 21 | + ( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python, string.quoted.docstring.python | ||
| 22 | + ''' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 23 | + docstring : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 24 | + ''' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 25 | + ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python, string.quoted.docstring.python | ||
| 26 | + """ : punctuation.definition.string.end.python, source.python, string.quoted.docstring.python | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,42 @@ | |||
| 1 | + def foo(): | ||
| 2 | + '''>>> print("""docstring""")''' | ||
| 3 | + def foo(): | ||
| 4 | + """>>> print('''docstring''')""" | ||
| 5 | + | ||
| 6 | + | ||
| 7 | + | ||
| 8 | + | ||
| 9 | + def : meta.function.python, source.python, storage.type.function.python | ||
| 10 | + : meta.function.python, source.python | ||
| 11 | + foo : entity.name.function.python, meta.function.python, source.python | ||
| 12 | + ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python | ||
| 13 | + ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python | ||
| 14 | + : : meta.function.python, punctuation.section.function.begin.python, source.python | ||
| 15 | + : source.python | ||
| 16 | + ''' : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python | ||
| 17 | + >>> : source.python, string.quoted.docstring.python | ||
| 18 | + : source.python, string.quoted.docstring.python | ||
| 19 | + print : meta.function-call.python, source.python, string.quoted.docstring.python, support.function.builtin.python | ||
| 20 | + ( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python, string.quoted.docstring.python | ||
| 21 | + """ : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 22 | + docstring : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 23 | + """ : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.docstring.python, string.quoted.double.multi.python | ||
| 24 | + ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python, string.quoted.docstring.python | ||
| 25 | + ''' : punctuation.definition.string.end.python, source.python, string.quoted.docstring.python | ||
| 26 | + def : meta.function.python, source.python, storage.type.function.python | ||
| 27 | + : meta.function.python, source.python | ||
| 28 | + foo : entity.name.function.python, meta.function.python, source.python | ||
| 29 | + ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python | ||
| 30 | + ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python | ||
| 31 | + : : meta.function.python, punctuation.section.function.begin.python, source.python | ||
| 32 | + : source.python | ||
| 33 | + """ : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python | ||
| 34 | + >>> : source.python, string.quoted.docstring.python | ||
| 35 | + : source.python, string.quoted.docstring.python | ||
| 36 | + print : meta.function-call.python, source.python, string.quoted.docstring.python, support.function.builtin.python | ||
| 37 | + ( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python, string.quoted.docstring.python | ||
| 38 | + ''' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 39 | + docstring : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 40 | + ''' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.docstring.python, string.quoted.single.multi.python | ||
| 41 | + ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python, string.quoted.docstring.python | ||
| 42 | + """ : punctuation.definition.string.end.python, source.python, string.quoted.docstring.python | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments