Skip to content

Commit ffd8343

Browse files
authoredDec 18, 2021
Xojo: Proper token name for directives (#3263)
1 parent aa73d44 commit ffd8343

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed
 

‎components/prism-xojo.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Prism.languages.xojo = {
22
'comment': {
3-
pattern: /(?:'|\/\/|Rem\b).+/i
3+
pattern: /(?:'|\/\/|Rem\b).+/i,
4+
greedy: true
45
},
56
'string': {
67
pattern: /"(?:""|[^"])*"/,
@@ -10,7 +11,10 @@ Prism.languages.xojo = {
1011
/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
1112
/&[bchou][a-z\d]+/i
1213
],
13-
'symbol': /#(?:Else|ElseIf|Endif|If|Pragma)\b/i,
14+
'directive': {
15+
pattern: /#(?:Else|ElseIf|Endif|If|Pragma)\b/i,
16+
alias: 'property'
17+
},
1418
'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,
1519
'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|WeakAddressOf|Xor)\b/i,
1620
'punctuation': /[.,;:()]/

‎components/prism-xojo.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#If
2+
#Else
3+
#ElseIf
4+
#Endif
5+
#Pragma
6+
7+
----------------------------------------------------
8+
9+
[
10+
["directive", "#If"],
11+
["directive", "#Else"],
12+
["directive", "#ElseIf"],
13+
["directive", "#Endif"],
14+
["directive", "#Pragma"]
15+
]
16+
17+
----------------------------------------------------
18+
19+
Checks for conditional compilation and pragma.

‎tests/languages/xojo/symbol_feature.test

-19
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.