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

pls fix the damn highlight #60

Open
OpenA opened this issue Sep 6, 2017 · 2 comments
Open

pls fix the damn highlight #60

OpenA opened this issue Sep 6, 2017 · 2 comments

Comments

@OpenA
Copy link

OpenA commented Sep 6, 2017

code example:

var example = function(a1) {

	var $class = 'unfunc';
	var $count = parseInt('1', 10) + parseInt (a1, 10);
	
	if(isNaN($count)) {
		$count = new Number(1);
	}
	
	if (isNaN ($count)) {
		$count = new Number (1);
	}
	
	switch($count) {
		case 1:
			$class = 'unfunc-one';
			break
		case 2:
			$class = 'unfunc-two';
			break;
		default:
			$class = 'unfunc-max';
	}
	
	switch ($count) {
		case 1:
			$class = 'unfunc-one';
			break
		case 2:
			$class = 'unfunc-two';
			break;
		default:
			$class = 'unfunc-max';
	}
	
	return $class;
}

and this is how it looks in textmate:
default

@nipuman
Copy link

nipuman commented Sep 12, 2017

The problem appears since the following commit:
a25c487#diff-f9061b7ed77660fb3007f1ac9e80f984

@patrickrgaffney Do you have an idea? Thank you!

@OpenA
Copy link
Author

OpenA commented Apr 8, 2019

some grammar fixes

diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist
index dd46b1f..cd80a4b 100644
--- a/Syntaxes/JavaScript.plist
+++ b/Syntaxes/JavaScript.plist
@@ -48,7 +48,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&lt;!\.)\b(import)(?!\s*:)\b</string>
+			<string>(?&lt;!\.|\$)\b(import)(?!\s*:)\b</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>1</key>
@@ -266,7 +266,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&lt;!\.)\b(export)(?!\s*:)\b</string>
+			<string>(?&lt;!\.|\$)\b(export)(?!\s*:)\b</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>1</key>
@@ -628,7 +628,7 @@
 		<dict>
 			<key>begin</key>
 			<string>(?x)
-                \b(class)(?=\s|$)
+                (?<!\.|\$)\b(class)(?=\s|$)
                 (?:
                     \s+
                     ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)
@@ -825,7 +825,7 @@
 				</dict>
 			</dict>
 			<key>match</key>
-			<string>(?&lt;!\.)\b(yield)(?!\s*:)\b(?:\s*(\*))?</string>
+			<string>(?&lt;!\.|\$)\b(yield)(?!\s*:)\b(?:\s*(\*))?</string>
 			<key>name</key>
 			<string>meta.control.yield.js</string>
 		</dict>
@@ -1239,7 +1239,7 @@
 				</dict>
 			</array>
 		</dict>
-		<key>function-call</key>
+	<!-- key>function-call</key>
 		<dict>
 			<key>patterns</key>
 			<array>
@@ -1280,7 +1280,7 @@
 					</array>
 				</dict>
 			</array>
-		</dict>
+		</dict -->
 		<key>function-params</key>
 		<dict>
 			<key>patterns</key>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants