Closes #200 Makes escaped hex include lowercase hex chars#201
Closes #200 Makes escaped hex include lowercase hex chars#201ValarDragon wants to merge 2 commits intoatom:masterfrom
Conversation
grammars/python.cson
Outdated
| '13': | ||
| 'name': 'constant.character.escape.vertical-tab.python' | ||
| 'match': '(\\\\x[0-9A-F]{2})|(\\\\[0-7]{3})|(\\\\\\n)|(\\\\\\\\)|(\\\\\\")|(\\\\\')|(\\\\a)|(\\\\b)|(\\\\f)|(\\\\n)|(\\\\r)|(\\\\t)|(\\\\v)' | ||
| 'match': '(\\\\x[0-9A-Fa-f]{2})|(\\\\[0-7]{3})|(\\\\\\n)|(\\\\\\\\)|(\\\\\\")|(\\\\\')|(\\\\a)|(\\\\b)|(\\\\f)|(\\\\n)|(\\\\r)|(\\\\t)|(\\\\v)' |
There was a problem hiding this comment.
The [0-9A-Fa-f] part can probably be replaced by \\h, which is the shortcut for hex in Oniguruma.
There was a problem hiding this comment.
Thanks! Fixed that in the second commit.
|
Thanks. One more thing - could you please add a few specs so that this behavior won't regress? I can help you out if you're having trouble how the specs work. |
|
Could you please help me out, I don't actually know how the specs coffee file works. |
|
Is there documentation about what should be put in the specs coffeescript file? |
|
Hi @ValarDragon, sorry for the delay in getting back to you. First of all, I'd like to apologize for my review comment, which I've recently found out is non-standard regex behavior ( Regarding specs, here's a simple example that you can build off of: https://github.com/atom/language-javascript/blob/4f41fa5ee25a8059175cc073866d2a699dfbf280/spec/javascript-spec.coffee#L228-L233. You will need to change the scope names and alter the tested line to test the changes of this PR. If you still need help just ask. You can get scopes by using the |
Description of the Change
This makes the atom interpreter recognize lowercase hex characters in escaped hex sequences.
Alternate Designs
None were proposed, this is a simple bug fix. The original developer likely forgot that lowercase hex chars can be used.
Benefits
Escaped hex with a lowercase hex character such as "\x4a" will now be recongized as an escaped hex sequence.
Possible Drawbacks
None
Applicable Issues
#200