-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Tag names fixes #33
Tag names fixes #33
Conversation
The code from the screenshot: http://pastebin.com/MkpPkKdH |
Interesting. I didn't know you can have whitespace between Probably also need to ignore result = sell < buy? foo() : bar(); |
This borks: |
Ok so after re-reading the spec, I came up with a better match and fixed another bug. Basically, tag names are |
Nice. For false positive scopes, I think we're hitting the limits of regex. I haven't looked in too much, but I'm wondering if there can be |
Alright, did laundry all that good saturday stuff, all the while, thinking about this. I stopped fucking around and looked at the tests: https://github.com/facebook/react/blob/5126cee/vendor/fbtransform/transforms/__tests__/react-test.js So, I removed |
Now it'll only match jsx tags if the identifier is immediately followed by a space or (self-)closing bracket. This is to avoid the case where unspaced greater-than comparisons are confused with jsx tags. Also narrowed the allowed chars for identifiers to match the spec.
4d9be18
to
1172e2a
Compare
See #29.
This is still tag-like, nothing I can do about this case:
But the rest looks good: