-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Xojo. Fix #898 #994
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"require": "basic"
seems to be left over...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed my mind in the middle, and forgot to remove it here, indeed. Thank you so much for reviewing ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no problem. Thank you for your great work!