-
Notifications
You must be signed in to change notification settings - Fork 203
Fix problem with syntax highlihtingting #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This was easily visible by comparing look of those two lines: let x;x=<div/> let x=<div/>
Fix problem with syntax highlihtingting
Phew ... Thanks 🌹 This was driving me crazy, I guess you are breaking on newlines, and that fixes it? /cc @Cu3PO42 |
release with |
@prefiks Thank you. |
I think problem with changed rules was that both begin and end regexes could match zero width string, so they could not advance current position. Optimization added in 1.0.15 didn't like that, and caused problem with highlighting. |
Note to self : http://www.apeth.com/nonblog/stories/textmatebundle.html |
} | ||
] | ||
|
||
'type': | ||
'begin': '(?=)' | ||
'begin': '(?=[\\(\\{\\p{L}\\p{Nl}$_])' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to understand how this code is designed to work.
See https://regex101.com/r/qO2zF7/1
What's up with matching p
or {L}
etc. ... or am I misreading this. Thanks for the fix btw. Perhaps all we needed was literals (
and {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some regexp implementations, that would work for internationalisation categories - matches letters or number letters.
Reference: http://xregexp.com/plugins/, no idea if Atom supports it personally, but I know they do fix some back references and other regexp features.
Edit: If you switch to PHP in the link you posted, you'll see what I imagine is desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense now https://regex101.com/r/cZ1zZ6/1 . Cheers 🌹
So first a disclaimer, i almost completely don't know how those grammar files should be working, pretty much just tried some things until got results i wanted, it may broke some other things.
Those changes fixes two things that were bothering me, first missing syntax in atom 1.0.15+ and second change fixes missing missing syntax highlighting of jsx elements in some context (for example in
return <something/>
orlet v = <value/>