This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Fix parsing of raw strings containing unclosed parentheses and brackets#37
Merged
kevinsawicki merged 2 commits intoatom:masterfrom Nov 7, 2014
Merged
Conversation
Strings like r'[' and r'(' were causing the rest of the document to be
parsed as if it were inside the regex. Now we terminate the regex at the
closing quote in all cases.
This is a backport of
textmate/python.tmbundle@2567262
grammars/python.cson
Outdated
Contributor
There was a problem hiding this comment.
This will combine to a single object with duplicate include keys when compiled to JavaSript:
'patterns': [
{
'include': '#constant_placeholder',
'include': '#escaped_unicode_char',
'include': '#escaped_char',
'include': '#regular_expressions'
}
]You probably want it to be:
'patterns': [
{'include': '#constant_placeholder'}
{'include': '#escaped_unicode_char'}
{'include': '#escaped_char'}
{'include': '#regular_expressions'}
]
Contributor
Author
There was a problem hiding this comment.
You're right. I guess I should make the tests sensitive to that bug.
My CSON formatting was bad, which caused only the regular expression grammar to get parsed inside of raw strings.
a5d798c to
c2120ec
Compare
Contributor
Author
|
@kevinsawicki This is ready for review again. |
Contributor
Author
|
The diff is a little hard to read (though much less so than the original XML diff!). The summary is that these rules have been changed from |
Contributor
|
🚢 |
kevinsawicki
added a commit
that referenced
this pull request
Nov 7, 2014
Fix parsing of raw strings containing unclosed parentheses and brackets
Contributor
|
Published as 0.23 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Strings like
r'['andr'('were causing the rest of the document to be parsed as if it were inside the regex. Now we terminate the regex at the closing quote in all cases.This is a backport of textmate/python.tmbundle@2567262
/cc @vmg