Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Xojo: Proper token name for directives (#3263)
  • Loading branch information
RunDevelopment committed Dec 18, 2021
1 parent aa73d44 commit ffd8343
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
8 changes: 6 additions & 2 deletions components/prism-xojo.js
@@ -1,6 +1,7 @@
Prism.languages.xojo = {
'comment': {
pattern: /(?:'|\/\/|Rem\b).+/i
pattern: /(?:'|\/\/|Rem\b).+/i,
greedy: true
},
'string': {
pattern: /"(?:""|[^"])*"/,
Expand All @@ -10,7 +11,10 @@ Prism.languages.xojo = {
/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
/&[bchou][a-z\d]+/i
],
'symbol': /#(?:Else|ElseIf|Endif|If|Pragma)\b/i,
'directive': {
pattern: /#(?:Else|ElseIf|Endif|If|Pragma)\b/i,
alias: 'property'
},
'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|Boolean|Break|By(?:Ref|Val)|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(?:8|16|32|64|eger|erface)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Shared|Short|Single|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:8|16|32|64|eger)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,
'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|WeakAddressOf|Xor)\b/i,
'punctuation': /[.,;:()]/
Expand Down
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.

19 changes: 19 additions & 0 deletions tests/languages/xojo/directive_feature.test
@@ -0,0 +1,19 @@
#If
#Else
#ElseIf
#Endif
#Pragma

----------------------------------------------------

[
["directive", "#If"],
["directive", "#Else"],
["directive", "#ElseIf"],
["directive", "#Endif"],
["directive", "#Pragma"]
]

----------------------------------------------------

Checks for conditional compilation and pragma.
19 changes: 0 additions & 19 deletions tests/languages/xojo/symbol_feature.test

This file was deleted.

0 comments on commit ffd8343

Please sign in to comment.