Skip to content

Commit

Permalink
Xojo: REM is no longer highlighted as a keyword in comments (#2823)
Browse files Browse the repository at this point in the history
REM was incorrectly identified as a keyword. This has been fixed. REM is now recognized as a comment.
  • Loading branch information
XojoGermany committed Mar 22, 2021
1 parent 7e51b99 commit ebbbfd4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
7 changes: 2 additions & 5 deletions 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: /"(?:""|[^"])*"/,
Expand All @@ -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': /[.,;:()]/
};
2 changes: 1 addition & 1 deletion components/prism-xojo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/languages/xojo/comment_feature.test
Expand Up @@ -5,9 +5,9 @@ Rem Foobar
----------------------------------------------------

[
["comment", ["' Foobar"]],
["comment", ["// Foobar"]],
["comment", [["keyword", "Rem"], " Foobar"]]
["comment", "' Foobar"],
["comment", "// Foobar"],
["comment", "Rem Foobar"]
]

----------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions tests/languages/xojo/keyword_feature.test
Expand Up @@ -71,7 +71,6 @@ Ptr
Raise
RaiseEvent
ReDim
Rem
RemoveHandler
Return
Select
Expand Down Expand Up @@ -183,7 +182,6 @@ WString
["keyword", "Raise"],
["keyword", "RaiseEvent"],
["keyword", "ReDim"],
["keyword", "Rem"],
["keyword", "RemoveHandler"],
["keyword", "Return"],
["keyword", "Select"],
Expand Down

0 comments on commit ebbbfd4

Please sign in to comment.