Skip to content
Permalink
Browse files
Xojo: Proper token name for directives (#3263)
  • Loading branch information
RunDevelopment committed Dec 18, 2021
1 parent aa73d44 commit ffd8343f330f98df6406d84d71b1365767ec2f2a
Showing with 26 additions and 22 deletions.
  1. +6 −2 components/prism-xojo.js
  2. +1 −1 components/prism-xojo.min.js
  3. +19 −0 tests/languages/xojo/directive_feature.test
  4. +0 −19 tests/languages/xojo/symbol_feature.test
@@ -1,6 +1,7 @@
Prism.languages.xojo = {
'comment': {
pattern: /(?:'|\/\/|Rem\b).+/i
pattern: /(?:'|\/\/|Rem\b).+/i,
greedy: true
},
'string': {
pattern: /"(?:""|[^"])*"/,
@@ -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': /[.,;:()]/

Some generated files are not rendered by default. Learn more.

@@ -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.

This file was deleted.

0 comments on commit ffd8343

Please sign in to comment.