You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Seems to be that the issue relates to the following corner case:
raw string prefix
triple-quoted string
containing backslashes
related to brackets in the string
Here are three instances of the bug that result in slightly different syntax:
Break 1:
before()
r'''(\)'''after()
Break 2:
before()
r'''(\'''
after()
Break 3:
before()
r'''[\'''
after()
The last example shows different highlighting for after() -- I think in the original case it's not that the docstring fails to end, but that the active "highlighting mode" is affected by characters in the string somehow.
Looks like the grammar is possibly trying to greedily highlight regex and hence not bailing when the regex is invalid but the string is closed.
This doesn't quite explain what's going on in the MySQLdb1 file linked in the OP though, though that might just be the regex matching gone wrong as well.
@alexjurkiewicz actually, after testing your snippets in a Python REPL, your second snippet is semi-intended behaviour. Python considers r'''(\''' to be an unclosed string, although it seems to be stuck in regex mode after the open parenthesis:
r'''(\''''''hello()
Similar issue here, except we're dealing with regex classes:
Activity
erbridge commentedon Mar 18, 2015
See also e.g. https://github.com/cobrateam/splinter/blob/master/splinter/browser.py#L46. Everything between the
"""s should be quoted.alexjurkiewicz commentedon Apr 13, 2015
Seems to be that the issue relates to the following corner case:
Here are three instances of the bug that result in slightly different syntax:
Break 1:
Break 2:
Break 3:
The last example shows different highlighting for after() -- I think in the original case it's not that the docstring fails to end, but that the active "highlighting mode" is affected by characters in the string somehow.
Some working examples:
Works 1:
Works 2:
Works 3:
auscompgeek commentedon Sep 13, 2015
Looks like the grammar is possibly trying to greedily highlight regex and hence not bailing when the regex is invalid but the string is closed.
This doesn't quite explain what's going on in the MySQLdb1 file linked in the OP though, though that might just be the regex matching gone wrong as well.
auscompgeek commentedon Oct 4, 2015
@alexjurkiewicz actually, after testing your snippets in a Python REPL, your second snippet is semi-intended behaviour. Python considers
r'''(\'''to be an unclosed string, although it seems to be stuck in regex mode after the open parenthesis:Similar issue here, except we're dealing with regex classes:
This works as expected/intended:
auscompgeek commentedon Oct 4, 2015
Guess this is just #39 then?
alexjurkiewicz commentedon Oct 6, 2015
yes, confusing!