-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #994 from Golmote/prism-xojo
Add support for Xojo. Fix #898
- Loading branch information
Showing
12 changed files
with
321 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Prism.languages.xojo = { | ||
'comment': { | ||
pattern: /(?:'|\/\/|Rem\b).+/i, | ||
inside: { | ||
'keyword': /^Rem/i | ||
} | ||
}, | ||
'string': { | ||
pattern: /"(?:""|[^"])*"/, | ||
greedy: true | ||
}, | ||
'number': [ | ||
/(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i, | ||
/&[bchou][a-z\d]+/i | ||
], | ||
'symbol': /#(?:If|Else|ElseIf|Endif|Pragma)\b/i, | ||
'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|By(?:Ref|Val)|Break|Call|Case|Catch|Const|Continue|CurrentMethodName|Declare|Dim|Do(?:wnTo)?|Each|Else(?:If)?|End|Exit|Extends|False|Finally|For|Global|If|In|Lib|Loop|Me|Next|Nil|Optional|ParamArray|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select|Self|Soft|Static|Step|Super|Then|To|True|Try|Ubound|Until|Using|Wend|While)\b/i, | ||
'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i, | ||
'punctuation': /[.,;:()]/ | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<h1>Xojo (REALbasic)</h1> | ||
<p>To use this language, use the class "language-xojo".</p> | ||
|
||
<h2>Comments</h2> | ||
<pre><code>' This is a comment | ||
// This is a comment too | ||
Rem This is a remark</code></pre> | ||
|
||
<h2>Strings</h2> | ||
<pre><code>"" | ||
"foo ""bar"" baz"</code></pre> | ||
|
||
<h2>Numbers and colors</h2> | ||
<pre><code>42 | ||
3.14159 | ||
3E4 | ||
&b0110 | ||
&cAABBCCDD | ||
&hBadFace | ||
&o777 | ||
&u9</code></pre> | ||
|
||
<h2>Example</h2> | ||
<pre><code>Dim g As Graphics | ||
Dim yOffSet As Integer | ||
g = OpenPrinterDialog() | ||
If g <> Nil Then | ||
If MainDishMenu.ListIndex <> -1 Then | ||
g.Bold = True | ||
g.DrawString("Main Dish:",20,20) | ||
g.Bold = False | ||
g.DrawString(MainDishMenu.Text,100,20) | ||
g.Bold = True | ||
g.DrawString("Side Order:",20,40) | ||
g.Bold = False | ||
If FriesRadio.Value Then | ||
g.DrawString(FriesRadio.Caption,100,40) | ||
End If | ||
If PotatoRadio.Value Then | ||
g.DrawString(PotatoRadio.Caption,100,40) | ||
End If | ||
If OnionRingRadio.Value Then | ||
g.DrawString(OnionRingRadio.Caption,100,40) | ||
End If | ||
yOffSet = 60 | ||
If CheeseCheckBox.Value Then | ||
g.Bold = True | ||
g.DrawString("Extra:",20,yOffSet) | ||
g.Bold = False | ||
g.DrawString(CheeseCheckBox.Caption,100,yOffSet) | ||
yOffSet = yOffSet + 20 | ||
End If | ||
If BaconCheckBox.Value Then | ||
g.Bold = True | ||
g.DrawString("Extra:",20,yOffSet) | ||
g.Bold = False | ||
g.DrawString(BaconCheckBox.Caption,100,yOffSet) | ||
yOffSet = yOffSet + 20 | ||
End If | ||
g.Bold = True | ||
g.DrawString("Notes:",20,yOffSet) | ||
g.Bold = False | ||
g.DrawString(NotesField.Text,100,yOffSet,(g.Width-40)) | ||
End If | ||
End If | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
' Foobar | ||
// Foobar | ||
Rem Foobar | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", ["' Foobar"]], | ||
["comment", ["// Foobar"]], | ||
["comment", [["keyword", "Rem"], " Foobar"]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments and remarks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
AddHandler | ||
App | ||
Array | ||
As | ||
Assigns | ||
ByRef | ||
ByVal | ||
Break | ||
Call | ||
Case | ||
Catch | ||
Const | ||
Continue | ||
CurrentMethodName | ||
Declare | ||
Dim | ||
Do | ||
DownTo | ||
Each | ||
Else | ||
ElseIf | ||
End | ||
Exit | ||
Extends | ||
False | ||
Finally | ||
For | ||
Global | ||
If | ||
In | ||
Lib | ||
Loop | ||
Me | ||
Next | ||
Nil | ||
Optional | ||
ParamArray | ||
Raise | ||
RaiseEvent | ||
ReDim | ||
Rem | ||
RemoveHandler | ||
Return | ||
Select | ||
Self | ||
Soft | ||
Static | ||
Step | ||
Super | ||
Then | ||
To | ||
True | ||
Try | ||
Ubound | ||
Until | ||
Using | ||
Wend | ||
While | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "AddHandler"], | ||
["keyword", "App"], | ||
["keyword", "Array"], | ||
["keyword", "As"], | ||
["keyword", "Assigns"], | ||
["keyword", "ByRef"], | ||
["keyword", "ByVal"], | ||
["keyword", "Break"], | ||
["keyword", "Call"], | ||
["keyword", "Case"], | ||
["keyword", "Catch"], | ||
["keyword", "Const"], | ||
["keyword", "Continue"], | ||
["keyword", "CurrentMethodName"], | ||
["keyword", "Declare"], | ||
["keyword", "Dim"], | ||
["keyword", "Do"], | ||
["keyword", "DownTo"], | ||
["keyword", "Each"], | ||
["keyword", "Else"], | ||
["keyword", "ElseIf"], | ||
["keyword", "End"], | ||
["keyword", "Exit"], | ||
["keyword", "Extends"], | ||
["keyword", "False"], | ||
["keyword", "Finally"], | ||
["keyword", "For"], | ||
["keyword", "Global"], | ||
["keyword", "If"], | ||
["keyword", "In"], | ||
["keyword", "Lib"], | ||
["keyword", "Loop"], | ||
["keyword", "Me"], | ||
["keyword", "Next"], | ||
["keyword", "Nil"], | ||
["keyword", "Optional"], | ||
["keyword", "ParamArray"], | ||
["keyword", "Raise"], | ||
["keyword", "RaiseEvent"], | ||
["keyword", "ReDim"], | ||
["keyword", "Rem"], | ||
["keyword", "RemoveHandler"], | ||
["keyword", "Return"], | ||
["keyword", "Select"], | ||
["keyword", "Self"], | ||
["keyword", "Soft"], | ||
["keyword", "Static"], | ||
["keyword", "Step"], | ||
["keyword", "Super"], | ||
["keyword", "Then"], | ||
["keyword", "To"], | ||
["keyword", "True"], | ||
["keyword", "Try"], | ||
["keyword", "Ubound"], | ||
["keyword", "Until"], | ||
["keyword", "Using"], | ||
["keyword", "Wend"], | ||
["keyword", "While"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keywords. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
42 | ||
3.14159 | ||
0.5e8 | ||
5.7e-74 | ||
&b0110 | ||
&cBadFace0 | ||
&hBadFace | ||
&o742 | ||
&u9 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["number", "42"], | ||
["number", "3.14159"], | ||
["number", "0.5e8"], | ||
["number", "5.7e-74"], | ||
["number", "&b0110"], | ||
["number", "&cBadFace0"], | ||
["number", "&hBadFace"], | ||
["number", "&o742"], | ||
["number", "&u9"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for numbers and colors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
< <= <> | ||
> >= | ||
+ - * | ||
/ \ ^ | ||
= | ||
AddressOf And | ||
Ctype Is IsA | ||
Mod New Not | ||
Or Xor WeakAddressOf | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "<"], ["operator", "<="], ["operator", "<>"], | ||
["operator", ">"], ["operator", ">="], | ||
["operator", "+"], ["operator", "-"], ["operator", "*"], | ||
["operator", "/"], ["operator", "\\"], ["operator", "^"], | ||
["operator", "="], | ||
["operator", "AddressOf"], ["operator", "And"], | ||
["operator", "Ctype"], ["operator", "Is"], ["operator", "IsA"], | ||
["operator", "Mod"], ["operator", "New"], ["operator", "Not"], | ||
["operator", "Or"], ["operator", "Xor"], ["operator", "WeakAddressOf"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"" | ||
"""" | ||
"Foo ""bar""" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", "\"\""], | ||
["string", "\"\"\"\""], | ||
["string", "\"Foo \"\"bar\"\"\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#If | ||
#Else | ||
#ElseIf | ||
#Endif | ||
#Pragma | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["symbol", "#If"], | ||
["symbol", "#Else"], | ||
["symbol", "#ElseIf"], | ||
["symbol", "#Endif"], | ||
["symbol", "#Pragma"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for conditional compilation and pragma. |