Skip to content
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

$ in JavaScript is matched as keyword.operator (and generally incorrectly) #21

Closed
titoBouzout opened this issue Dec 22, 2014 · 1 comment

Comments

@titoBouzout
Copy link
Collaborator

From @FichteFoll on August 20, 2014 22:41

Dollar signs ($) are valid characters for any javascript identifier, which probably everyone knows since jQuery.

From the ECMAScript specification:

The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. The dollar sign is intended for use only in mechanically generated code.

Thus, the following code is highlighted wrong:

$test = $(".test");
$function = "this is an identifier, not a keyword";
some$var$ = 1;

2014-08-21_00 23 48

In the above snippet, (?<![a-zA-Z_])\$(?![a-zA-Z_]) matches only the dollar sign in $(".test") and should be matched as variable.other.dollar-sign or similar.

Copied from original issue: sublimehq/sublime_text#431

@FichteFoll
Copy link
Contributor

Is source.js variable.other.dollar.js punctuation.dollar.js now (and has been variable.other.readwrite previously).

See also sublimehq/Packages#141.

@FichteFoll FichteFoll added this to the Build 3087 milestone Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants