-
Notifications
You must be signed in to change notification settings - Fork 56
Conversation
Per the specification, `this` is a JavaScript keyword that is forbidden from being used as a variable or property name. So we should tokenize it as a keyword and not a variable. See: http://coffeescript.org/documentation/docs/lexer.html#section-69 Fixes #36
@@ -244,7 +244,7 @@ | |||
'name': 'constant.language.null.coffee' | |||
} | |||
{ | |||
'match': '\\b(?<!\\.)(this|extends)(?!\\s*[:=])\\b' | |||
'match': '\\b(?<!\\.)(extends)(?!\\s*[:=])\\b' |
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.
Mind 🔥 the parens around extends
since they are no longer needed?
Done. Thanks! |
So, looking at this a bit more, this PR would make CoffeeScript different than several other languages with Similarly PHP uses Also, this changes makes instance variable assignments that use |
Yeah, there is definitely a tension between the fact that it is a keyword but it is used as an implicitly-declared variable. Perhaps we should add another signifier so that people can color |
@lee-dohm That sounds good to me, adding another class is a great way to make it targetable |
@kevinsawicki Changed it as discussed and updated the test. Going to open Issues on the other languages you mentioned. |
Looking good 👍 |
Tokenize 'this' as a keyword
See: atom/language-coffee-script#39 Fixes atom#6 Added minimal specs which were completely absent.
Per the specification,
this
is a JavaScript keyword that is forbidden from being used as a variable or property name. So we should tokenize it as a keyword and not a variable.See: http://coffeescript.org/documentation/docs/lexer.html#section-69
Fixes #36