From 459365ecc110ba205d84286a6d8cd6895778881f Mon Sep 17 00:00:00 2001 From: XojoGermany <1276539+XojoGermany@users.noreply.github.com> Date: Wed, 17 Mar 2021 00:43:23 +0100 Subject: [PATCH] Xojo: Added missing keywords (#2805) --- components/prism-xojo.js | 4 +- components/prism-xojo.min.js | 2 +- tests/languages/xojo/keyword_feature.test | 100 +++++++++++++++++++++- 3 files changed, 102 insertions(+), 4 deletions(-) diff --git a/components/prism-xojo.js b/components/prism-xojo.js index 47bfe791d3..32d2618a34 100644 --- a/components/prism-xojo.js +++ b/components/prism-xojo.js @@ -14,7 +14,7 @@ Prism.languages.xojo = { /&[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, + 'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|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(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i, 'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i, 'punctuation': /[.,;:()]/ -}; +}; \ No newline at end of file diff --git a/components/prism-xojo.min.js b/components/prism-xojo.min.js index 2f07a90b56..a897cf4b2c 100644 --- a/components/prism-xojo.min.js +++ b/components/prism-xojo.min.js @@ -1 +1 @@ -Prism.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i,inside:{keyword:/^Rem/i}},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\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:/[.,;:()]/}; \ No newline at end of file +Prism.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i,inside:{keyword:/^Rem/i}},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|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(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/}; \ No newline at end of file diff --git a/tests/languages/xojo/keyword_feature.test b/tests/languages/xojo/keyword_feature.test index 52a419b245..afef7ae416 100644 --- a/tests/languages/xojo/keyword_feature.test +++ b/tests/languages/xojo/keyword_feature.test @@ -3,38 +3,71 @@ App Array As Assigns +Auto +Boolean ByRef +Byte ByVal Break Call Case Catch +CFStringRef +CGFloat +Class +Color Const Continue +CString +Currency CurrentMethodName Declare +Delegate Dim Do +Double DownTo Each Else ElseIf End +Enumeration +Event +Exception Exit Extends False Finally For +Function +Get +GetTypeInfo Global +GOTO If +Implements In +Inherits +Integer +Interface +Int8 +Int16 +Int32 +Int64 Lib Loop Me +Module Next Nil +Object Optional ParamArray +Private +Property +Protected +PString +Ptr Raise RaiseEvent ReDim @@ -43,19 +76,35 @@ RemoveHandler Return Select Self +Set +Single +Shared +Short Soft Static Step +String +Sub Super +Text Then To True Try Ubound +UInteger +UInt8 +UInt16 +UInt32 +UInt64 Until Using +Var +Variant Wend While +WindowPtr +WString ---------------------------------------------------- @@ -65,38 +114,71 @@ While ["keyword", "Array"], ["keyword", "As"], ["keyword", "Assigns"], + ["keyword", "Auto"], + ["keyword", "Boolean"], ["keyword", "ByRef"], + ["keyword", "Byte"], ["keyword", "ByVal"], ["keyword", "Break"], ["keyword", "Call"], ["keyword", "Case"], ["keyword", "Catch"], + ["keyword", "CFStringRef"], + ["keyword", "CGFloat"], + ["keyword", "Class"], + ["keyword", "Color"], ["keyword", "Const"], ["keyword", "Continue"], + ["keyword", "CString"], + ["keyword", "Currency"], ["keyword", "CurrentMethodName"], ["keyword", "Declare"], + ["keyword", "Delegate"], ["keyword", "Dim"], ["keyword", "Do"], + ["keyword", "Double"], ["keyword", "DownTo"], ["keyword", "Each"], ["keyword", "Else"], ["keyword", "ElseIf"], ["keyword", "End"], + ["keyword", "Enumeration"], + ["keyword", "Event"], + ["keyword", "Exception"], ["keyword", "Exit"], ["keyword", "Extends"], ["keyword", "False"], ["keyword", "Finally"], ["keyword", "For"], + ["keyword", "Function"], + ["keyword", "Get"], + ["keyword", "GetTypeInfo"], ["keyword", "Global"], + ["keyword", "GOTO"], ["keyword", "If"], + ["keyword", "Implements"], ["keyword", "In"], + ["keyword", "Inherits"], + ["keyword", "Integer"], + ["keyword", "Interface"], + ["keyword", "Int8"], + ["keyword", "Int16"], + ["keyword", "Int32"], + ["keyword", "Int64"], ["keyword", "Lib"], ["keyword", "Loop"], ["keyword", "Me"], + ["keyword", "Module"], ["keyword", "Next"], ["keyword", "Nil"], + ["keyword", "Object"], ["keyword", "Optional"], ["keyword", "ParamArray"], + ["keyword", "Private"], + ["keyword", "Property"], + ["keyword", "Protected"], + ["keyword", "PString"], + ["keyword", "Ptr"], ["keyword", "Raise"], ["keyword", "RaiseEvent"], ["keyword", "ReDim"], @@ -105,19 +187,35 @@ While ["keyword", "Return"], ["keyword", "Select"], ["keyword", "Self"], + ["keyword", "Set"], + ["keyword", "Single"], + ["keyword", "Shared"], + ["keyword", "Short"], ["keyword", "Soft"], ["keyword", "Static"], ["keyword", "Step"], + ["keyword", "String"], + ["keyword", "Sub"], ["keyword", "Super"], + ["keyword", "Text"], ["keyword", "Then"], ["keyword", "To"], ["keyword", "True"], ["keyword", "Try"], ["keyword", "Ubound"], + ["keyword", "UInteger"], + ["keyword", "UInt8"], + ["keyword", "UInt16"], + ["keyword", "UInt32"], + ["keyword", "UInt64"], ["keyword", "Until"], ["keyword", "Using"], + ["keyword", "Var"], + ["keyword", "Variant"], ["keyword", "Wend"], - ["keyword", "While"] + ["keyword", "While"], + ["keyword", "WindowPtr"], + ["keyword", "WString"] ] ----------------------------------------------------