Commit ebbbfd471b1688106adfa686a17151744a4affc4

XojoGermany 2021-03-22T13:03:36

Xojo: `REM` is no longer highlighted as a keyword in comments (#2823) REM was incorrectly identified as a keyword. This has been fixed. REM is now recognized as a comment.

diff --git a/components/prism-xojo.js b/components/prism-xojo.js
index 9c6671e..a1a514b 100644
--- a/components/prism-xojo.js
+++ b/components/prism-xojo.js
@@ -1,9 +1,6 @@
 Prism.languages.xojo = {
 	'comment': {
-		pattern: /(?:'|\/\/|Rem\b).+/i,
-		inside: {
-			'keyword': /^Rem/i
-		}
+		pattern: /(?:'|\/\/|Rem\b).+/i
 	},
 	'string': {
 		pattern: /"(?:""|[^"])*"/,
@@ -14,7 +11,7 @@ Prism.languages.xojo = {
 		/&[bchou][a-z\d]+/i
 	],
 	'symbol': /#(?:If|Else|ElseIf|Endif|Pragma)\b/i,
-	'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,
+	'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,
 	'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,
 	'punctuation': /[.,;:()]/
 };
\ No newline at end of file
diff --git a/components/prism-xojo.min.js b/components/prism-xojo.min.js
index e2b92c0..0748cb6 100644
--- a/components/prism-xojo.min.js
+++ b/components/prism-xojo.min.js
@@ -1 +1 @@
-Prism.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i,inside:{keyword:/^Rem/i}},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/};
\ No newline at end of file
+Prism.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/};
\ No newline at end of file
diff --git a/tests/languages/xojo/comment_feature.test b/tests/languages/xojo/comment_feature.test
index c980136..9e66f29 100644
--- a/tests/languages/xojo/comment_feature.test
+++ b/tests/languages/xojo/comment_feature.test
@@ -5,9 +5,9 @@ Rem Foobar
 ----------------------------------------------------
 
 [
-	["comment", ["' Foobar"]],
-	["comment", ["// Foobar"]],
-	["comment", [["keyword", "Rem"], " Foobar"]]
+	["comment", "' Foobar"],
+	["comment", "// Foobar"],
+	["comment", "Rem Foobar"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/xojo/keyword_feature.test b/tests/languages/xojo/keyword_feature.test
index f611dcf..dd9e565 100644
--- a/tests/languages/xojo/keyword_feature.test
+++ b/tests/languages/xojo/keyword_feature.test
@@ -71,7 +71,6 @@ Ptr
 Raise
 RaiseEvent
 ReDim
-Rem
 RemoveHandler
 Return
 Select
@@ -183,7 +182,6 @@ WString
 	["keyword", "Raise"],
 	["keyword", "RaiseEvent"],
 	["keyword", "ReDim"],
-	["keyword", "Rem"],
 	["keyword", "RemoveHandler"],
 	["keyword", "Return"],
 	["keyword", "Select"],