-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(apex): rearrange class for readability (#29)
refactor(params): simplify parameter usage, moving most to top-level Of note: moving keyword lists to a separate file prevents the build/test process refactor: moved some matchers to named objects for better readability test: add illegal strings to prevent recognizing as other languages (clojure, gams, mathematica) test: update expected markup after removing extra scope words
Showing
5 changed files
with
640 additions
and
688 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,3 +114,6 @@ typings/ | |
.pmdCache | ||
|
||
demo/scratchpad.* | ||
|
||
# temp directory | ||
temp |
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 |
---|---|---|
@@ -1,112 +1,105 @@ | ||
/*! `apex` grammar compiled for Highlight.js 11.9.0 */ | ||
var hljsGrammar=(()=>{"use strict";return e=>{ | ||
const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="\\b"+a+"\\b",c="@"+a,s=/(?=\s*\()/,o=/\s+/ | ||
;function i(...e){return t.concat("(?!",e.join("|"),")")}const r={ | ||
const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="\\b"+a+"\\b",c="@"+a,o=/(?=\s*\()/,s=/\s+/,r=/\?\.\b/,i=[{ | ||
match:/(?<!\?)\./,scope:"punctuation",relevance:0},{match:r,scope:"operator", | ||
relevance:0}];function l(...e){return t.concat("(?!",e.join("|"),")")}const p={ | ||
scope:"number", | ||
match:t.either(/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(\-|\+)\d{2}\:\d{2})\b/,/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(Z)?)\b/,/\b(\d{4}\-\d{2}\-\d{2})\b/,/\b0(x|X)[0-9a-fA-F_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b0(b|B)[01_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b([0-9]+)?\.[0-9]+((e|E)[0-9]+)?(F|f|D|d|M|m)?\b/,/(-?)\b[0-9]+(e|E)[0-9]+(F|f|D|d|M|m)?\b/,/(-?)\b[0-9]+(F|f|D|d|M|m)\b/,/(-?)\b[0-9]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/(-?)(\b0[0-9]+|(\b\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)/), | ||
relevance:0 | ||
},l=["try","catch","finally","get","set","put","if","for","else","do","while","continue","break","implements","extends","return","throw","when","new"],b=["instanceof","super","this"],p={ | ||
match:t.concat(/\b/,t.either(...b),/\b/),scope:"variable.language",relevance:0 | ||
},u=["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|10","selectoption|10","short|0","sobject|10","string|0","time|0","void|0","float|0"],d=["insert","update","upsert","delete","undelete","merge","convertLead"],m=["AppLauncher","Approval","Auth","Cache","Canvas","ChatterAnswers","CommercePayments","ConnectApi","Database","Datacloud","Dataweave","DataSource","Dom","EventBus","ExternalService","Flow","Functions","Invocable","KbManagement","LxScheduler","Messaging","Metadata","Pref_center","Process","QuickAction","Reports","RichMessageing","Search","Sfc","Sfdc_Checkout","sfdc_surveys","Site","Support","System","TerritoryMgmt","TxnSecurity","UserProvisioning","VisualEditor","Wave"],E=["AccessLevel","Address","Answers","ApexPages","Approval","Assert","AsyncInfo","AsyncOptions","BusinessHours","Cases","Collator","Continuation","Cookie","Crypto","Database","Date","Datetime","Decimal","Domain","DomainCreator","DomainParser","EmailMessages","EncodingUtil","EventBus","Exception","FeatureManagement","FlexQueue","Formula","FormulaRecalcFieldError","FormulaRecalcResult","Http","HttpRequest","HttpResponse","Ideas","JSON","JSONGenerator","JSONParser","Label","Limits","Location","Matcher","Math","Messaging","MultiStaticResourceCalloutMock","Network","OrgLimit","OrgLimits","Packaging","PageReference","Pattern","QueueableDuplicateSignature","QueueableDuplicateSignature.Builder","QuickAction","Request","ResetPasswordResult","RestContext","RestRequest","RestResponse","Schema","Search","Security","SelectOption","Site","SObject","SObjectAccessDecision","StaticResourceCalloutMock","Test","TimeZone","Type","URL","UserInfo","UserManagement","Version","WebServiceCallout","XmlStreamReader","XmlStreamWriter"],A=m.concat(...E),h=[{ | ||
match:[t.concat(/\b/,t.either("AccessType","AccessLevel","DomainType","JSONToken","LoggingLevel","Quiddity","TriggerOperation","operationType")),/\./,a,/(?![\.\(])/], | ||
scope:{1:"built_in",2:"punctuation",3:"variable.constant"},relevance:0},{ | ||
match:t.concat(/\b/,t.either(...m),t.concat("\b(?!\\.",t.either(...E),")")), | ||
scope:"built_in",relevance:0},{ | ||
match:[/\b/,"System",/\./,t.either(...E),/(?=\.)/],scope:{2:"built_in", | ||
3:"punctuation",4:"built_in"},relevance:5},{ | ||
match:[t.concat("(?<=\\b",t.either(...A),")"),/\./,a,t.lookahead(/[\(\s]/)], | ||
scope:{2:"punctuation",3:"keyword"},relevance:0},{ | ||
begin:t.concat(/\b/,"Trigger",/\b/),beginScope:"built_in",variants:[{ | ||
end:[/\./,/(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size|operationType)\b(?!\.)/], | ||
endScope:{1:"punctuation",2:"keyword"},relevance:10},{ | ||
end:[/\./,"operationtype",/\./,n],endScope:{1:"punctuation",2:"keyword", | ||
3:"punctuation",4:"variable.constant"},relevance:10}] | ||
}],S=["false","true","null"],v={match:/(?<!\.)\bId\b/,scope:"type",relevance:8 | ||
},g={$pattern:t.concat(/(?<!\.)/,n), | ||
keyword:l.concat("abstract","final","global","interface","override","private","protected","public","static","testMethod","transient","virtual","webservice").concat(...d), | ||
"variable.language":b,built_in:A,type:u,literal:S},R=[{ | ||
match:t.either(",",/(?<!=\?)(\.)/,";",/(?<=\w)(\>)/,/(\<)(?=\w)/,/\{|\}/,/\(|\)/,/\{|\}/), | ||
scope:"punctuation",relevance:0}],T=e.inherit(e.APOS_STRING_MODE,{contains:[{ | ||
match:/\\'/,scope:"literal"}],scope:"string",relevance:0 | ||
}),y=e.COMMENT("//",/[$\n]/,{relevance:0}),O=[e.COMMENT("/\\*","\\*/",{ | ||
},b=["try","catch","finally","get","set","put","if","for","else","do","while","continue","break","implements","extends","return","throw","when","new"],u=["instanceof","super","this"],d=["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|8","selectoption|8","short|0","sobject|10","string|0","time|0","void|0","float|0"],m=["AppLauncher","Approval","Auth","Cache","Canvas","ChatterAnswers","CommercePayments","ConnectApi","Database","Datacloud","Dataweave","DataSource","Dom","EventBus","ExternalService","Flow","Functions","Invocable","KbManagement","LxScheduler","Messaging","Metadata","Pref_center","Process","QuickAction","Reports","RichMessageing","Schema","Search","Sfc","Sfdc_Checkout","sfdc_surveys","Site","Support","System","TerritoryMgmt","TxnSecurity","UserProvisioning","VisualEditor","Wave"],E=["false","true","null"],A={ | ||
match:/,/,scope:"punctuation",relevance:0 | ||
},h=[/--/,/\+\+/,/\&\&|\|\|/,/\*\=|\/\=|\%\=|\+\=|-\=/,/\&\=|\^\=|<<\=|>>\=|>>>\=|\|\=/,/\&|~|\^|\|/,/<<|>>/,/<\=|>\=|\s(<|>)\s/,/\=\=|!\=/,/\=>/,/!(?=\w)/,/(?<=\s)(\?|:)(?=\s)/,r,/(?<!\?)\?(?!\?|\.|\[)/,/%[^%]|\*[^\/]|\/[^\/\*]|(?<!\-)\-(?!\-)|(?<!\+)\+(?!\+)/,/(?<!\=|!)\=(?!\=|>)/],S=m.concat("AccessLevel","Address","Answers","ApexPages","Approval","Assert","AsyncInfo","AsyncOptions","BusinessHours","Cases","Collator","Continuation","Cookie","Crypto","Database","Date","Datetime","Decimal","Domain","DomainCreator","DomainParser","EmailMessages","EncodingUtil","EventBus","Exception","FeatureManagement","FlexQueue","Formula","FormulaRecalcFieldError","FormulaRecalcResult","Http","HttpRequest","HttpResponse","Ideas","JSON","JSONGenerator","JSONParser","Label","Limits","Location","Matcher","Math","Messaging","MultiStaticResourceCalloutMock","Network","OrgLimit","OrgLimits","Packaging","PageReference","Pattern","QueueableDuplicateSignature","QueueableDuplicateSignature.Builder","QuickAction","Request","ResetPasswordResult","RestContext","RestRequest","RestResponse","Search","Security","SelectOption","Site","SObject","SObjectAccessDecision","StaticResourceCalloutMock","Test","TimeZone","Type","URL","UserInfo","UserManagement","Version","WebServiceCallout","XmlStreamReader","XmlStreamWriter"),v={ | ||
$pattern:t.concat(/(?<!\.)\b/,a,/\b/), | ||
keyword:[...b,"abstract","final","global","interface","override","private","protected","public","static","testMethod","transient","virtual","webservice","insert","update","upsert","delete","undelete","merge","convertLead"], | ||
"variable.language":u,built_in:S,type:d,literal:E},T={ | ||
match:t.concat(/\b/,t.either(...u),/\b/),scope:"variable.language",relevance:0 | ||
},R=[{match:[/\b/,t.either(...m),/\./,a,/(?=\.)/],scope:{2:"built_in",4:"type"} | ||
},{match:[/\b/,t.either(...m),/\./,a,/\b(?!\.|\()/],scope:{2:"built_in", | ||
3:"punctuation",4:"keyword"}},{match:[/\b/,t.either(...m),/\./,a,o],scope:{ | ||
2:"built_in",3:"punctuation",4:"keyword"}},{ | ||
match:[t.concat(/\b/,t.either("AccessType","AccessLevel","DomainType","JSONToken","LoggingLevel","Quiddity","TriggerOperation","operationType")),/\??\./,a,/\s*(?![\.\(])/], | ||
scope:{1:"built_in",2:"punctuation",3:"variable"},relevance:0},{ | ||
match:[/\bTrigger\b/,/\./,/(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size|operationType)\b(?!\.)/], | ||
scope:{1:"built_in",2:"punctuation",3:"type"},relevance:10},{ | ||
match:[/\btrigger\b/,/\./,"operationtype",/\./,t.concat(n,/\b/)],scope:{ | ||
1:"built_in",2:"punctuation",3:"keyword",4:"punctuation",5:"variable.constant"}, | ||
relevance:10}],g=[{ | ||
match:t.either(",",/;/,/(?<=\w)\>/,/\<(?=\w)/,/\{|\}/,/\(|\)/,/\{|\}/), | ||
scope:"punctuation",relevance:0},A],y=e.inherit(e.APOS_STRING_MODE,{ | ||
scope:"string",relevance:0,contains:[{match:/\\'/,scope:"literal",relevance:0}] | ||
}),O=e.COMMENT("//",/[$\n]/,{relevance:0}),L=[e.COMMENT("/\\*","\\*/",{ | ||
relevance:0,contains:[{begin:/\w+@/,relevance:0},{ | ||
match:[/@(?:exception|throws)/,o,a],scope:{1:"doctag",3:"title.class"}, | ||
match:[/@(?:exception|throws)/,s,a],scope:{1:"doctag",3:"title.class"}, | ||
relevance:0},{begin:"@[A-Za-z_-]+",scope:"doctag",relevance:0},{ | ||
match:[/(?<=@param)\s+/,a],scope:{2:"variable"},relevance:0},{begin:"`",end:"`", | ||
beginScope:"hidden",endScope:"hidden",scope:"string", | ||
contains:[e.BACKSLASH_ESCAPE],relevance:0}]}),y],L={ | ||
match:t.concat(/(?<=\W|\b|\s)/,t.either(/--/,/\+\+/,/\&\&|\|\|/,/\*\=|\/\=|\%\=|\+\=|-\=/,/\&\=|\^\=|<<\=|>>\=|>>>\=|\|\=/,/\&|~|\^|\|/,/<<|>>/,/<\=|>\=|\s(<|>)\s/,/\=\=|!\=/,/\=>/,/!(?=\w)/,/(?<=\s)(\?|:)(?=\s)/,/\?\./,/(?<!\?)\?(?!\?|\.|\[)/,/%[^%]|\*[^\/]|\/[^\/\*]|(?<!\-)\-(?!\-)|(?<!\+)\+(?!\+)/,/(?<!\=|!)\=(?!\=|>)/),/(?=\W|\b|\s)/), | ||
scope:"operator",relevance:0},N=[{match:t.concat(c,/\b(?!\s*\()/),scope:"meta" | ||
},{begin:[t.concat(c,/\b/),/\s*/,/\(/],beginScope:{1:"meta",3:"punctuation"}, | ||
end:/(?=\))/,contains:[{match:[n,/\s*=/],scope:{2:"operator"},contains:[L] | ||
},T,r],keywords:{literal:S}}],D=[{match:[/\b[a-zA-Z0-9\.]*Exception/,o,a], | ||
scope:{1:"title.class",3:"variable"},relevance:0}],_=[{ | ||
begin:/\b(list|set|map)(?=\s*<)/,beginScope:"type",end:/\>+/, | ||
endScope:"punctuation",contains:[{match:/\<|,/,scope:"punctuation"},{match:n, | ||
scope:"type"}],relevance:8},{match:[t.optional(n),/\[/,t.optional(/\d+/),/\]/], | ||
scope:{1:"variable",2:"punctuation",3:"number",4:"punctuation"}},{ | ||
match:[a,/\[\]/],scope:{1:"type",2:"punctuation"},relevance:0}],w=[{ | ||
match:[/(?<!\.)\b/,a,/\s*(?=\=[^\>])/],scope:{2:"variable"},relevance:0},{ | ||
match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"},relevance:0}],C={ | ||
match:[/(?<=[^\w\.])/,t.concat(/\b/,a,/__(c|pc|r|b|e|mdt|x|share|kav|ka|history|del|s)/,/\b/),/(?=[\(\s;,])/], | ||
scope:{2:"type"},relevance:10},I=[{match:[/\bnew\s+/,a,s],scope:{2:"type"}, | ||
relevance:0}],U={begin:/\((?!(\s*\[))/,beginScope:"punctuation",end:/\)/, | ||
endScope:"punctuation",relevance:0,keywords:{KEYWORDS:g},illegal:l, | ||
contains:[T,I,O,L,_,h,r,v,{keywords:{KEYWORDS:g}, | ||
match:t.concat(/(?<=\s|\(|\,)/,i(...S),a,/\b/,/(?!\.)/),scope:"variable"},{ | ||
match:/\,|\./,scope:"punctuation"}]},M={scope:"params declare",end:/\)/, | ||
endScope:"punctuation",relevance:0,keywords:{KEYWORDS:g},illegal:l, | ||
contains:[r,T,O,_,h,{match:/\,|\(/,scope:"punctuation"},v,{ | ||
match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{match:[o,a,/\s*(?=[,)])/], | ||
scope:{2:"variable"}}]},f=[{begin:[/\btrigger/,o,a,o,"on",o,a],beginScope:{ | ||
1:"keyword",3:"title.class",5:"operator",7:"type"},end:/(?=\{)/,returnEnd:!0, | ||
contains:[O,{begin:/\(/,end:/\)/,contains:[{ | ||
scope:"string",contains:[e.BACKSLASH_ESCAPE],relevance:0}]}),O],N={ | ||
match:t.either(...h),scope:"operator",relevance:0},w={match:/(?<!\.)\bId\b/, | ||
scope:"type",relevance:8},C=[{begin:/\b(list|set|map)(?=\s*<)/, | ||
beginScope:"type",end:/\>+/,endScope:"punctuation",contains:[{match:/\<|\,/, | ||
scope:"punctuation"},{match:n,scope:"type"}],relevance:8},{ | ||
match:[t.optional(n),/\[/,t.optional(/\d+/),/\]/],scope:{1:"variable", | ||
2:"punctuation",3:"number",4:"punctuation"}},{match:[a,/\[\]/],scope:{1:"type", | ||
2:"punctuation"},relevance:0}],D=[{match:t.concat(c,/\b(?!\s*\()/),scope:"meta" | ||
},{scope:"meta",begin:[t.concat(c,/\b/),/\s*/,/\(/],beginScope:{3:"punctuation" | ||
},end:/\)/,endScope:"punctuation",contains:[{match:[n,/\s*=/],scope:{ | ||
1:"keyword",2:"operator"},contains:[N]},y,p],keywords:{literal:E}}],I={ | ||
match:[/\b[a-zA-Z0-9\.]*Exception/,s,a],scope:{1:"title.class",3:"variable"}, | ||
relevance:0},_={match:[/(?<!\.)/,n,/\s*(?=\=[^\>])/],scope:{2:"variable"}, | ||
relevance:0},U={match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"}, | ||
relevance:0},M={match:[/\bnew\s+/,a,o],scope:{2:"type"},relevance:0},f={ | ||
begin:/\((?!(\s*\[))/,beginScope:"punctuation",end:/\)/,endScope:"punctuation", | ||
relevance:0,keywords:v,contains:[y,M,L,N,C,R,p,w,{keywords:{KEYWORDS:v}, | ||
match:t.concat(/(?<=\s|\(|\,)/,l(...E),a,/\b/,/(?!\.)/),scope:"variable", | ||
relevance:0},{match:/\,|\./,scope:"punctuation",relevance:0}]},k=[{ | ||
match:[t.concat(/\b/,l(...S)),/\??(?<=\.)/,a,o],scope:{3:"title.function.invoke" | ||
},relevance:0},{match:[/^\s*/,l(...b),a,o],scope:{3:"title.function.invoke"}, | ||
relevance:0}],F={scope:"params",end:/\)/,endScope:"punctuation",relevance:0, | ||
keywords:v,illegal:b,contains:[p,y,L,C,...R,{match:/\,|\(/,scope:"punctuation" | ||
},w,{match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{ | ||
match:[s,a,/\s*(?=[,)])/],scope:{2:"variable"}}]},Y=[{ | ||
begin:[/\btrigger/,s,a,s,"on",s,a],beginScope:{1:"keyword",3:"title.class", | ||
5:"operator",7:"type"},end:/(?=\{)/,returnEnd:!0,contains:[L,{begin:/\(/, | ||
end:/\)/,contains:[{ | ||
match:/\b(before|after)\s+(insert|update|delete|merge|undelete)\b/, | ||
scope:"built_in",relevance:5}]}]},{relevance:5, | ||
scope:"keyword",relevance:5},A]}]},{relevance:5, | ||
match:/\b(with|without|inherited)\s+sharing\b/,scope:"keyword"},{ | ||
begin:[/[^\.]/,/\bclass\b/],beginScope:{2:"keyword"},end:/(?=\{)/,relevance:0, | ||
keywords:{type:u,keyword:l},contains:[{match:[/(?<=\bclass)\s+/,a],scope:{ | ||
2:"title.class"}},{returnEnd:!0,endsWithParent:!0,variants:[{ | ||
beginKeywords:"implements",end:/\bextends\b|\{/},{beginKeywords:"extends", | ||
end:/\bimplements\b|\{/}],contains:[h,{match:[n,/\./,a,/(?=[,\s<])/],scope:{ | ||
1:"built_in",3:"title.class.inherited"}},{match:t.concat(n,/(?=>)/),scope:"type" | ||
},{match:t.concat(n,/(?!<)/),scope:"title.class.inherited"},{ | ||
begin:[/(?!\.)/,/\bclass\b(?!\?|\.)/],beginScope:{2:"keyword"},end:/(?=\{)/, | ||
relevance:1,keywords:{type:d,keyword:b},contains:[{match:[/(?<=\bclass)\s+/,a], | ||
scope:{2:"title.class"}},{returnEnd:!0,endsWithParent:!0, | ||
beginKeywords:"implements extends",end:/\{/,contains:[R,{match:[n,/(?=\.)/], | ||
scope:{1:"built_in"}},{match:t.concat(n,/(?=>)/),scope:"type"},{ | ||
match:t.concat(/\b/,t.either("schedulable","batchable","queueable","comparable","callable"),/\b\s*(?!>)/), | ||
scope:"title.class.inherited",relevance:8}],relevance:0}]},{ | ||
match:[/(public|private|protected)\s+/,a,s],scope:{1:"keyword", | ||
2:"title.function"},starts:M,relevance:0},{ | ||
match:[/(?<!new)(?<!return)(?<=\<|\>|\w)\s+/,a,s],scope:{2:"title.function"}, | ||
relevance:0,starts:M},{begin:[/\benum\s+/,a,/\s*(?=\{)/],beginScope:{2:"type"}, | ||
end:/(?=[\}\n])/,relevance:0,contains:[O,R,{match:t.concat(n), | ||
scope:"variable.constant"}]}],k=[{match:t.concat(i(...l),/\b/,a,s), | ||
scope:"title.function.invoke method_call",starts:U,relevance:0},{ | ||
match:[t.concat("(?<!\\b",t.either(...A),")"),/\./,a,s],scope:{2:"punctuation", | ||
3:"title.function.invoke dot"},starts:U,relevance:0}],F={ | ||
match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword",2:"variable"}},Y={ | ||
begin:[/\[/,/\s*/,/(?=(SELECT|FIND)\b)/],beginScope:{1:"punctuation"},end:/\]/, | ||
endScope:"punctuation",scope:"soql",relevance:10,endsWithParent:!0,keywords:{ | ||
keyword:[].concat(...g.keyword).concat("ABOVE_OR_BELOW","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","ASC","BY","CATEGORY","CONTAINS","CUSTOM","DATA","DESC","DIVISION","END","FIELDS","FIND","FROM","LAST","METADATA","NETWORK","ON","ORDER","RETURNING","ROLLUP","ROWS","SEARCH","SELECT","SNIPPET","SORT","SPELL_CORRECTION","STANDARD","USER_MODE","WHERE","PricebookId","WITH","SECURITY_ENFORCED","USING","SCOPE","Delegated","Everything","Mine","My_Territory","My_Team_Territory","Team","TYPEOF","ELSE","END","THEN","WHEN").concat("ABOVE","AND","AT","BY","CATEGORY","DATA","FIRST","FOR","GROUP","HAVING","IN","LAST","LIKE","LIMIT","LISTVIEW","NOT","NULLS","OFFSET","OR","REFERENCE","TRACKING","TYPEOF","UPDATE","UPDATE","VIEW","VIEWSTAT"), | ||
scope:"title.class.inherited",relevance:8},{match:t.concat(n,/(?!<)/), | ||
scope:"title.class.inherited"},{match:/<|>|,/,scope:"punctuation"}],relevance:0 | ||
}]},{begin:[/\benum\s+/,a,/\s*\{/],beginScope:{2:"type",3:"punctuation"}, | ||
end:/\}/,endScope:"punctuation",relevance:0,contains:[L,A,{match:t.concat(n), | ||
scope:"variable.constant"}]},{match:[/(public|private|protected)\s+/,a,o], | ||
scope:{1:"keyword",2:"title.function"},starts:F,relevance:0},{ | ||
match:[/(?<!new)(?<!return)(?<=\<|\>|\w)\s+/,a,o],scope:{2:"title.function"}, | ||
relevance:0,starts:F}],P={match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword", | ||
2:"variable"}},W={ | ||
keyword:[].concat(...v.keyword).concat("ABOVE_OR_BELOW","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","ASC","BY","CATEGORY","CONTAINS","CUSTOM","DATA","DESC","DIVISION","END","FIELDS","FIND","FROM","LAST","METADATA","NETWORK","ON","ORDER","RETURNING","ROLLUP","ROWS","SEARCH","SELECT","SNIPPET","SORT","SPELL_CORRECTION","STANDARD","USER_MODE","WHERE","PricebookId","WITH","SECURITY_ENFORCED","USING","SCOPE","Delegated","Everything","Mine","My_Territory","My_Team_Territory","Team","TYPEOF","ELSE","END","THEN","WHEN").concat("ABOVE","AND","AT","BY","CATEGORY","DATA","FIRST","FOR","GROUP","HAVING","IN","LAST","LIKE","LIMIT","LISTVIEW","NOT","NULLS","OFFSET","OR","REFERENCE","TRACKING","TYPEOF","UPDATE","UPDATE","VIEW","VIEWSTAT"), | ||
type:["AVG","convertCurrency","convertTimezone","COUNT_DISTINCT","COUNT","DISTANCE","EXCLUDES","FORMAT","GEOLOCATION","GROUP BY CUBE","GROUP BY ROLLUP","GROUPING","INCLUDES","MAX","MIN","SUM","toLabel"], | ||
"title.function":["DAY_IN_MONTH","HOUR_IN_DAY","DAY_IN_WEEK","DAY_IN_YEAR","DAY_ONLY","CALENDAR_MONTH","CALENDAR_QUARTER","CALENDAR_YEAR","FISCAL_MONTH","FISCAL_QUARTER","FISCAL_YEAR","TODAY","TOMORROW","YESTERDAY","WEEK_IN_MONTH","WEEK_IN_YEAR"], | ||
literal:g.literal,built_in:A},contains:[{begin:/\bSELECT\b/, | ||
beginScope:"keyword",end:/\bFROM\b/,returnEnd:!0,contains:[R,{ | ||
match:[/(?=[\s\,])/,a,/(?=[\s\,])/],scope:{2:"subst"}}]},{begin:[/\bFROM/,o,n], | ||
beginScope:{1:"keyword",3:"type"},end:/(?=\]|\s|\))/,contains:[{ | ||
match:[/(?<=\.)/,n],scope:{2:"type"}}]},{match:/:/,scope:"operator"},{ | ||
literal:v.literal,built_in:S};return{name:"Apex", | ||
aliases:["apex","lightning","soql"],case_insensitive:!0,disableAutodetect:!1, | ||
ignoreIllegals:!1,keywords:v, | ||
illegal:["</","<#","<]","<div>","\x3c!--","!DOCTYPE",/<iframe\b/,/^#/,/^import \.[a-zA-Z]+\./,/^import [\w]+/,/^import$/,/^include </,/^use\s+</,/\b(const|var)\s+\w+\s*=/,/\bstruct\b/,"System.log","console.log",/\bfor\s+\w+\s+IN\s+/,/\bif\s+\w+\s+IN\s+/,/\bend\s+if\b/,/\bend\s+select\b/,/\b(int|var)\s+\w+\s+=/,/\b(int[0-9]+|bool)\b/,/\b\$/,/\b_/,"::=",/\s#[a-zA-Z]/,/\s_[a-zA-Z]/,/\s\$[a-zA-Z]/,"#if","%if",/\bif(?!\s+\()/,"%endif","#endif","#_",/\d\s+\d/,/\w::\w/,/\bfloat\b/,/(SELECT|RETURNING)\s+\*/,/END\s+LOOP/,/CREATE\s+FUNCTION/,/\bint\b/,/import\s+\w+\s+=\s+require\("\w+"\)/,"/^include\b/",/\buse\s+strict\b/,/\w+\s+=\s+"\S*";/,/\/include\//,/\Anamespace\b/,/\bend(\.)?\n/,'"""',/\+\+\+/,/<%/,"<%#","%%>","<%%",":-",/\bmergesort\(/,/\bvar\s+env\b/,/\bdef\b\s\W:/,/"[^"]+"/,/\(\*|\*\)/], | ||
contains:[D,U,C,L,Y,[{match:/as\s+(user|system)\b/,scope:"keyword"}],i,I,{ | ||
match:[/\bfor\b\s*/,/\(/,a,s,a,/\s*/,/:/],scope:{3:"type",5:"variable", | ||
7:"operator"}},k,M,T,R,p,N,f,g,w,{begin:[/\[/,/\s*(?=(SELECT|FIND)\b)/], | ||
end:/\]/,beginScope:{1:"punctuation"},endScope:"punctuation",scope:"soql", | ||
relevance:10,endsWithParent:!0,keywords:W,contains:[{begin:/\bSELECT\b/, | ||
beginScope:"keyword",end:/\bFROM\b/,returnEnd:!0,keywords:W,contains:[A,{ | ||
match:[/(?=[\s\,])/,a,/(?=[\s\,])/],scope:{2:"subst"}}]},p,N,y,A,{match:/\(|\)/, | ||
scope:"punctuation",relevance:0},...i,{begin:[/\bFROM\b/,s],beginScope:{ | ||
1:"keyword"},end:/(?=\bWHERE\b|\]|\s|\))/,contains:[{match:a,scope:"type"},...i] | ||
},{ | ||
match:/(NEXT|LAST|THIS)_(90_DAY|DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S?\b/, | ||
scope:"keyword",relevance:10},{ | ||
scope:"keyword",relevance:8},{ | ||
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/], | ||
scope:{1:"keyword",2:"operator",3:"number"},relevance:10},{ | ||
match:[/(?<=:)/,/\s*/,a],scope:{3:"variable"}},r,k,L,T,R],illegal:"::"},P={ | ||
begin:[/\bfor\b\s*/,/\(/,a,o,a,/\s*/,/:/],beginScope:{3:"type",5:"variable", | ||
7:"operator"},end:/(?=\{)/,contains:[O,Y,k,{match:t.concat(a,/\b(?!\()/), | ||
scope:"variable"},{match:t.concat(n,s),scope:"title.function.invoke for_loop"},{ | ||
match:/\{/,endsParent:!0},L,r,R]};return{name:"Apex", | ||
aliases:["apex","lightning","soql"],case_insensitive:!0,disableAutodetect:!1, | ||
ignoreIllegals:!1,keywords:g, | ||
illegal:["</","<#","<]","<div>","\x3c!--","!DOCTYPE",/<iframe\b/,/^#/,/^import \.[a-zA-Z]+\./,/^import [\w]+/,/^import$/,/^include </,/^use\s+</,/\b(const|var)\s+\w+\s*=/,/\bstruct\b/,"System.log","console.log",/\bfor\s+\w+\s+IN\s+/,/\bif\s+\w+\s+IN\s+/,/\bend\s+if\b/,/\bend\s+select\b/,/\b(int|var)\s+\w+\s+=/,/\b(int[0-9]+|bool)\b/,/\b\$/,"::=",/\s#[a-zA-Z]/,/\s_[a-zA-Z]/,/\s\$[a-zA-Z]/,"#if","%if",/\bif(?!\s+\()/,"%endif","#endif",/\w::\w/,/(SELECT|RETURNING)\s+\*/,/END\s+LOOP/,/CREATE\s+FUNCTION/,/\bint\b/,/import\s+\w+\s+=\s+require\("\w+"\)/,"/^include\b/",/\buse\s+strict\b/,/\w+\s+=\s+"\S*";/,/\/include\//,/\Anamespace\b/,/\bend(\.)?\n/,'"""',/\+\+\+/,/<%/,"<%#","%%>","<%%",":-",/\bmergesort\(/,/\bvar\s+env\b/,/\bdef\b\s\W:/,/"[^"]+"/], | ||
contains:[N,w,_,O,C,f,[{ | ||
match:[t.concat(/\b/,t.either(...d)),/\s+(?!\()/,t.optional(/as\s+(user|system)\b/)], | ||
scope:{3:"keyword"}},{begin:[/\bDatabase\b/,/\./,t.either(...d),s],beginScope:{ | ||
1:"built_in",2:"punctuation",3:"keyword invoke_database"},starts:U | ||
}],D,P,T,I,p,k,h,r,L,R,v,Y,F]}}})();export default hljsGrammar; | ||
scope:{1:"keyword",2:"operator",3:"number"},relevance:8},{ | ||
match:[/(?<=:)/,/\s*/,n,/(?!\()/],scope:{3:"variable"},relevance:0},{ | ||
match:[/(?<=:|\.)/,a,/(?=\s*\()/],scope:{2:"title.function.invoke"},relevance:0 | ||
},{match:/:/,scope:"operator",relevance:0}],illegal:"::"},y,P,_]}}})() | ||
;export default hljsGrammar; |
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 |
---|---|---|
@@ -1,112 +1,105 @@ | ||
/*! `apex` grammar compiled for Highlight.js 11.9.0 */ | ||
(()=>{var e=(()=>{"use strict";return e=>{ | ||
const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="\\b"+a+"\\b",c="@"+a,s=/(?=\s*\()/,o=/\s+/ | ||
;function i(...e){return t.concat("(?!",e.join("|"),")")}const r={ | ||
const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="\\b"+a+"\\b",c="@"+a,s=/(?=\s*\()/,o=/\s+/,i=/\?\.\b/,r=[{ | ||
match:/(?<!\?)\./,scope:"punctuation",relevance:0},{match:i,scope:"operator", | ||
relevance:0}];function l(...e){return t.concat("(?!",e.join("|"),")")}const p={ | ||
scope:"number", | ||
match:t.either(/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(\-|\+)\d{2}\:\d{2})\b/,/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(Z)?)\b/,/\b(\d{4}\-\d{2}\-\d{2})\b/,/\b0(x|X)[0-9a-fA-F_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b0(b|B)[01_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b([0-9]+)?\.[0-9]+((e|E)[0-9]+)?(F|f|D|d|M|m)?\b/,/(-?)\b[0-9]+(e|E)[0-9]+(F|f|D|d|M|m)?\b/,/(-?)\b[0-9]+(F|f|D|d|M|m)\b/,/(-?)\b[0-9]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/(-?)(\b0[0-9]+|(\b\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)/), | ||
relevance:0 | ||
},l=["try","catch","finally","get","set","put","if","for","else","do","while","continue","break","implements","extends","return","throw","when","new"],b=["instanceof","super","this"],p={ | ||
match:t.concat(/\b/,t.either(...b),/\b/),scope:"variable.language",relevance:0 | ||
},u=["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|10","selectoption|10","short|0","sobject|10","string|0","time|0","void|0","float|0"],d=["insert","update","upsert","delete","undelete","merge","convertLead"],m=["AppLauncher","Approval","Auth","Cache","Canvas","ChatterAnswers","CommercePayments","ConnectApi","Database","Datacloud","Dataweave","DataSource","Dom","EventBus","ExternalService","Flow","Functions","Invocable","KbManagement","LxScheduler","Messaging","Metadata","Pref_center","Process","QuickAction","Reports","RichMessageing","Search","Sfc","Sfdc_Checkout","sfdc_surveys","Site","Support","System","TerritoryMgmt","TxnSecurity","UserProvisioning","VisualEditor","Wave"],E=["AccessLevel","Address","Answers","ApexPages","Approval","Assert","AsyncInfo","AsyncOptions","BusinessHours","Cases","Collator","Continuation","Cookie","Crypto","Database","Date","Datetime","Decimal","Domain","DomainCreator","DomainParser","EmailMessages","EncodingUtil","EventBus","Exception","FeatureManagement","FlexQueue","Formula","FormulaRecalcFieldError","FormulaRecalcResult","Http","HttpRequest","HttpResponse","Ideas","JSON","JSONGenerator","JSONParser","Label","Limits","Location","Matcher","Math","Messaging","MultiStaticResourceCalloutMock","Network","OrgLimit","OrgLimits","Packaging","PageReference","Pattern","QueueableDuplicateSignature","QueueableDuplicateSignature.Builder","QuickAction","Request","ResetPasswordResult","RestContext","RestRequest","RestResponse","Schema","Search","Security","SelectOption","Site","SObject","SObjectAccessDecision","StaticResourceCalloutMock","Test","TimeZone","Type","URL","UserInfo","UserManagement","Version","WebServiceCallout","XmlStreamReader","XmlStreamWriter"],A=m.concat(...E),h=[{ | ||
match:[t.concat(/\b/,t.either("AccessType","AccessLevel","DomainType","JSONToken","LoggingLevel","Quiddity","TriggerOperation","operationType")),/\./,a,/(?![\.\(])/], | ||
scope:{1:"built_in",2:"punctuation",3:"variable.constant"},relevance:0},{ | ||
match:t.concat(/\b/,t.either(...m),t.concat("\b(?!\\.",t.either(...E),")")), | ||
scope:"built_in",relevance:0},{ | ||
match:[/\b/,"System",/\./,t.either(...E),/(?=\.)/],scope:{2:"built_in", | ||
3:"punctuation",4:"built_in"},relevance:5},{ | ||
match:[t.concat("(?<=\\b",t.either(...A),")"),/\./,a,t.lookahead(/[\(\s]/)], | ||
scope:{2:"punctuation",3:"keyword"},relevance:0},{ | ||
begin:t.concat(/\b/,"Trigger",/\b/),beginScope:"built_in",variants:[{ | ||
end:[/\./,/(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size|operationType)\b(?!\.)/], | ||
endScope:{1:"punctuation",2:"keyword"},relevance:10},{ | ||
end:[/\./,"operationtype",/\./,n],endScope:{1:"punctuation",2:"keyword", | ||
3:"punctuation",4:"variable.constant"},relevance:10}] | ||
}],S=["false","true","null"],g={match:/(?<!\.)\bId\b/,scope:"type",relevance:8 | ||
},v={$pattern:t.concat(/(?<!\.)/,n), | ||
keyword:l.concat("abstract","final","global","interface","override","private","protected","public","static","testMethod","transient","virtual","webservice").concat(...d), | ||
"variable.language":b,built_in:A,type:u,literal:S},R=[{ | ||
match:t.either(",",/(?<!=\?)(\.)/,";",/(?<=\w)(\>)/,/(\<)(?=\w)/,/\{|\}/,/\(|\)/,/\{|\}/), | ||
scope:"punctuation",relevance:0}],T=e.inherit(e.APOS_STRING_MODE,{contains:[{ | ||
match:/\\'/,scope:"literal"}],scope:"string",relevance:0 | ||
}),y=e.COMMENT("//",/[$\n]/,{relevance:0}),O=[e.COMMENT("/\\*","\\*/",{ | ||
},b=["try","catch","finally","get","set","put","if","for","else","do","while","continue","break","implements","extends","return","throw","when","new"],u=["instanceof","super","this"],d=["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|8","selectoption|8","short|0","sobject|10","string|0","time|0","void|0","float|0"],m=["AppLauncher","Approval","Auth","Cache","Canvas","ChatterAnswers","CommercePayments","ConnectApi","Database","Datacloud","Dataweave","DataSource","Dom","EventBus","ExternalService","Flow","Functions","Invocable","KbManagement","LxScheduler","Messaging","Metadata","Pref_center","Process","QuickAction","Reports","RichMessageing","Schema","Search","Sfc","Sfdc_Checkout","sfdc_surveys","Site","Support","System","TerritoryMgmt","TxnSecurity","UserProvisioning","VisualEditor","Wave"],E=["false","true","null"],A={ | ||
match:/,/,scope:"punctuation",relevance:0 | ||
},h=[/--/,/\+\+/,/\&\&|\|\|/,/\*\=|\/\=|\%\=|\+\=|-\=/,/\&\=|\^\=|<<\=|>>\=|>>>\=|\|\=/,/\&|~|\^|\|/,/<<|>>/,/<\=|>\=|\s(<|>)\s/,/\=\=|!\=/,/\=>/,/!(?=\w)/,/(?<=\s)(\?|:)(?=\s)/,i,/(?<!\?)\?(?!\?|\.|\[)/,/%[^%]|\*[^\/]|\/[^\/\*]|(?<!\-)\-(?!\-)|(?<!\+)\+(?!\+)/,/(?<!\=|!)\=(?!\=|>)/],S=m.concat("AccessLevel","Address","Answers","ApexPages","Approval","Assert","AsyncInfo","AsyncOptions","BusinessHours","Cases","Collator","Continuation","Cookie","Crypto","Database","Date","Datetime","Decimal","Domain","DomainCreator","DomainParser","EmailMessages","EncodingUtil","EventBus","Exception","FeatureManagement","FlexQueue","Formula","FormulaRecalcFieldError","FormulaRecalcResult","Http","HttpRequest","HttpResponse","Ideas","JSON","JSONGenerator","JSONParser","Label","Limits","Location","Matcher","Math","Messaging","MultiStaticResourceCalloutMock","Network","OrgLimit","OrgLimits","Packaging","PageReference","Pattern","QueueableDuplicateSignature","QueueableDuplicateSignature.Builder","QuickAction","Request","ResetPasswordResult","RestContext","RestRequest","RestResponse","Search","Security","SelectOption","Site","SObject","SObjectAccessDecision","StaticResourceCalloutMock","Test","TimeZone","Type","URL","UserInfo","UserManagement","Version","WebServiceCallout","XmlStreamReader","XmlStreamWriter"),v={ | ||
$pattern:t.concat(/(?<!\.)\b/,a,/\b/), | ||
keyword:[...b,"abstract","final","global","interface","override","private","protected","public","static","testMethod","transient","virtual","webservice","insert","update","upsert","delete","undelete","merge","convertLead"], | ||
"variable.language":u,built_in:S,type:d,literal:E},T={ | ||
match:t.concat(/\b/,t.either(...u),/\b/),scope:"variable.language",relevance:0 | ||
},g=[{match:[/\b/,t.either(...m),/\./,a,/(?=\.)/],scope:{2:"built_in",4:"type"} | ||
},{match:[/\b/,t.either(...m),/\./,a,/\b(?!\.|\()/],scope:{2:"built_in", | ||
3:"punctuation",4:"keyword"}},{match:[/\b/,t.either(...m),/\./,a,s],scope:{ | ||
2:"built_in",3:"punctuation",4:"keyword"}},{ | ||
match:[t.concat(/\b/,t.either("AccessType","AccessLevel","DomainType","JSONToken","LoggingLevel","Quiddity","TriggerOperation","operationType")),/\??\./,a,/\s*(?![\.\(])/], | ||
scope:{1:"built_in",2:"punctuation",3:"variable"},relevance:0},{ | ||
match:[/\bTrigger\b/,/\./,/(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size|operationType)\b(?!\.)/], | ||
scope:{1:"built_in",2:"punctuation",3:"type"},relevance:10},{ | ||
match:[/\btrigger\b/,/\./,"operationtype",/\./,t.concat(n,/\b/)],scope:{ | ||
1:"built_in",2:"punctuation",3:"keyword",4:"punctuation",5:"variable.constant"}, | ||
relevance:10}],R=[{ | ||
match:t.either(",",/;/,/(?<=\w)\>/,/\<(?=\w)/,/\{|\}/,/\(|\)/,/\{|\}/), | ||
scope:"punctuation",relevance:0},A],y=e.inherit(e.APOS_STRING_MODE,{ | ||
scope:"string",relevance:0,contains:[{match:/\\'/,scope:"literal",relevance:0}] | ||
}),O=e.COMMENT("//",/[$\n]/,{relevance:0}),L=[e.COMMENT("/\\*","\\*/",{ | ||
relevance:0,contains:[{begin:/\w+@/,relevance:0},{ | ||
match:[/@(?:exception|throws)/,o,a],scope:{1:"doctag",3:"title.class"}, | ||
relevance:0},{begin:"@[A-Za-z_-]+",scope:"doctag",relevance:0},{ | ||
match:[/(?<=@param)\s+/,a],scope:{2:"variable"},relevance:0},{begin:"`",end:"`", | ||
beginScope:"hidden",endScope:"hidden",scope:"string", | ||
contains:[e.BACKSLASH_ESCAPE],relevance:0}]}),y],L={ | ||
match:t.concat(/(?<=\W|\b|\s)/,t.either(/--/,/\+\+/,/\&\&|\|\|/,/\*\=|\/\=|\%\=|\+\=|-\=/,/\&\=|\^\=|<<\=|>>\=|>>>\=|\|\=/,/\&|~|\^|\|/,/<<|>>/,/<\=|>\=|\s(<|>)\s/,/\=\=|!\=/,/\=>/,/!(?=\w)/,/(?<=\s)(\?|:)(?=\s)/,/\?\./,/(?<!\?)\?(?!\?|\.|\[)/,/%[^%]|\*[^\/]|\/[^\/\*]|(?<!\-)\-(?!\-)|(?<!\+)\+(?!\+)/,/(?<!\=|!)\=(?!\=|>)/),/(?=\W|\b|\s)/), | ||
scope:"operator",relevance:0},N=[{match:t.concat(c,/\b(?!\s*\()/),scope:"meta" | ||
},{begin:[t.concat(c,/\b/),/\s*/,/\(/],beginScope:{1:"meta",3:"punctuation"}, | ||
end:/(?=\))/,contains:[{match:[n,/\s*=/],scope:{2:"operator"},contains:[L] | ||
},T,r],keywords:{literal:S}}],D=[{match:[/\b[a-zA-Z0-9\.]*Exception/,o,a], | ||
scope:{1:"title.class",3:"variable"},relevance:0}],_=[{ | ||
begin:/\b(list|set|map)(?=\s*<)/,beginScope:"type",end:/\>+/, | ||
endScope:"punctuation",contains:[{match:/\<|,/,scope:"punctuation"},{match:n, | ||
scope:"type"}],relevance:8},{match:[t.optional(n),/\[/,t.optional(/\d+/),/\]/], | ||
scope:{1:"variable",2:"punctuation",3:"number",4:"punctuation"}},{ | ||
match:[a,/\[\]/],scope:{1:"type",2:"punctuation"},relevance:0}],w=[{ | ||
match:[/(?<!\.)\b/,a,/\s*(?=\=[^\>])/],scope:{2:"variable"},relevance:0},{ | ||
match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"},relevance:0}],C={ | ||
match:[/(?<=[^\w\.])/,t.concat(/\b/,a,/__(c|pc|r|b|e|mdt|x|share|kav|ka|history|del|s)/,/\b/),/(?=[\(\s;,])/], | ||
scope:{2:"type"},relevance:10},I=[{match:[/\bnew\s+/,a,s],scope:{2:"type"}, | ||
relevance:0}],U={begin:/\((?!(\s*\[))/,beginScope:"punctuation",end:/\)/, | ||
endScope:"punctuation",relevance:0,keywords:{KEYWORDS:v},illegal:l, | ||
contains:[T,I,O,L,_,h,r,g,{keywords:{KEYWORDS:v}, | ||
match:t.concat(/(?<=\s|\(|\,)/,i(...S),a,/\b/,/(?!\.)/),scope:"variable"},{ | ||
match:/\,|\./,scope:"punctuation"}]},M={scope:"params declare",end:/\)/, | ||
endScope:"punctuation",relevance:0,keywords:{KEYWORDS:v},illegal:l, | ||
contains:[r,T,O,_,h,{match:/\,|\(/,scope:"punctuation"},g,{ | ||
match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{match:[o,a,/\s*(?=[,)])/], | ||
scope:{2:"variable"}}]},f=[{begin:[/\btrigger/,o,a,o,"on",o,a],beginScope:{ | ||
1:"keyword",3:"title.class",5:"operator",7:"type"},end:/(?=\{)/,returnEnd:!0, | ||
contains:[O,{begin:/\(/,end:/\)/,contains:[{ | ||
scope:"string",contains:[e.BACKSLASH_ESCAPE],relevance:0}]}),O],N={ | ||
match:t.either(...h),scope:"operator",relevance:0},w={match:/(?<!\.)\bId\b/, | ||
scope:"type",relevance:8},C=[{begin:/\b(list|set|map)(?=\s*<)/, | ||
beginScope:"type",end:/\>+/,endScope:"punctuation",contains:[{match:/\<|\,/, | ||
scope:"punctuation"},{match:n,scope:"type"}],relevance:8},{ | ||
match:[t.optional(n),/\[/,t.optional(/\d+/),/\]/],scope:{1:"variable", | ||
2:"punctuation",3:"number",4:"punctuation"}},{match:[a,/\[\]/],scope:{1:"type", | ||
2:"punctuation"},relevance:0}],D=[{match:t.concat(c,/\b(?!\s*\()/),scope:"meta" | ||
},{scope:"meta",begin:[t.concat(c,/\b/),/\s*/,/\(/],beginScope:{3:"punctuation" | ||
},end:/\)/,endScope:"punctuation",contains:[{match:[n,/\s*=/],scope:{ | ||
1:"keyword",2:"operator"},contains:[N]},y,p],keywords:{literal:E}}],I={ | ||
match:[/\b[a-zA-Z0-9\.]*Exception/,o,a],scope:{1:"title.class",3:"variable"}, | ||
relevance:0},_={match:[/(?<!\.)/,n,/\s*(?=\=[^\>])/],scope:{2:"variable"}, | ||
relevance:0},U={match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"}, | ||
relevance:0},M={match:[/\bnew\s+/,a,s],scope:{2:"type"},relevance:0},f={ | ||
begin:/\((?!(\s*\[))/,beginScope:"punctuation",end:/\)/,endScope:"punctuation", | ||
relevance:0,keywords:v,contains:[y,M,L,N,C,g,p,w,{keywords:{KEYWORDS:v}, | ||
match:t.concat(/(?<=\s|\(|\,)/,l(...E),a,/\b/,/(?!\.)/),scope:"variable", | ||
relevance:0},{match:/\,|\./,scope:"punctuation",relevance:0}]},k=[{ | ||
match:[t.concat(/\b/,l(...S)),/\??(?<=\.)/,a,s],scope:{3:"title.function.invoke" | ||
},relevance:0},{match:[/^\s*/,l(...b),a,s],scope:{3:"title.function.invoke"}, | ||
relevance:0}],F={scope:"params",end:/\)/,endScope:"punctuation",relevance:0, | ||
keywords:v,illegal:b,contains:[p,y,L,C,...g,{match:/\,|\(/,scope:"punctuation" | ||
},w,{match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{ | ||
match:[o,a,/\s*(?=[,)])/],scope:{2:"variable"}}]},Y=[{ | ||
begin:[/\btrigger/,o,a,o,"on",o,a],beginScope:{1:"keyword",3:"title.class", | ||
5:"operator",7:"type"},end:/(?=\{)/,returnEnd:!0,contains:[L,{begin:/\(/, | ||
end:/\)/,contains:[{ | ||
match:/\b(before|after)\s+(insert|update|delete|merge|undelete)\b/, | ||
scope:"built_in",relevance:5}]}]},{relevance:5, | ||
scope:"keyword",relevance:5},A]}]},{relevance:5, | ||
match:/\b(with|without|inherited)\s+sharing\b/,scope:"keyword"},{ | ||
begin:[/[^\.]/,/\bclass\b/],beginScope:{2:"keyword"},end:/(?=\{)/,relevance:0, | ||
keywords:{type:u,keyword:l},contains:[{match:[/(?<=\bclass)\s+/,a],scope:{ | ||
2:"title.class"}},{returnEnd:!0,endsWithParent:!0,variants:[{ | ||
beginKeywords:"implements",end:/\bextends\b|\{/},{beginKeywords:"extends", | ||
end:/\bimplements\b|\{/}],contains:[h,{match:[n,/\./,a,/(?=[,\s<])/],scope:{ | ||
1:"built_in",3:"title.class.inherited"}},{match:t.concat(n,/(?=>)/),scope:"type" | ||
},{match:t.concat(n,/(?!<)/),scope:"title.class.inherited"},{ | ||
begin:[/(?!\.)/,/\bclass\b(?!\?|\.)/],beginScope:{2:"keyword"},end:/(?=\{)/, | ||
relevance:1,keywords:{type:d,keyword:b},contains:[{match:[/(?<=\bclass)\s+/,a], | ||
scope:{2:"title.class"}},{returnEnd:!0,endsWithParent:!0, | ||
beginKeywords:"implements extends",end:/\{/,contains:[g,{match:[n,/(?=\.)/], | ||
scope:{1:"built_in"}},{match:t.concat(n,/(?=>)/),scope:"type"},{ | ||
match:t.concat(/\b/,t.either("schedulable","batchable","queueable","comparable","callable"),/\b\s*(?!>)/), | ||
scope:"title.class.inherited",relevance:8}],relevance:0}]},{ | ||
match:[/(public|private|protected)\s+/,a,s],scope:{1:"keyword", | ||
2:"title.function"},starts:M,relevance:0},{ | ||
scope:"title.class.inherited",relevance:8},{match:t.concat(n,/(?!<)/), | ||
scope:"title.class.inherited"},{match:/<|>|,/,scope:"punctuation"}],relevance:0 | ||
}]},{begin:[/\benum\s+/,a,/\s*\{/],beginScope:{2:"type",3:"punctuation"}, | ||
end:/\}/,endScope:"punctuation",relevance:0,contains:[L,A,{match:t.concat(n), | ||
scope:"variable.constant"}]},{match:[/(public|private|protected)\s+/,a,s], | ||
scope:{1:"keyword",2:"title.function"},starts:F,relevance:0},{ | ||
match:[/(?<!new)(?<!return)(?<=\<|\>|\w)\s+/,a,s],scope:{2:"title.function"}, | ||
relevance:0,starts:M},{begin:[/\benum\s+/,a,/\s*(?=\{)/],beginScope:{2:"type"}, | ||
end:/(?=[\}\n])/,relevance:0,contains:[O,R,{match:t.concat(n), | ||
scope:"variable.constant"}]}],k=[{match:t.concat(i(...l),/\b/,a,s), | ||
scope:"title.function.invoke method_call",starts:U,relevance:0},{ | ||
match:[t.concat("(?<!\\b",t.either(...A),")"),/\./,a,s],scope:{2:"punctuation", | ||
3:"title.function.invoke dot"},starts:U,relevance:0}],F={ | ||
match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword",2:"variable"}},Y={ | ||
begin:[/\[/,/\s*/,/(?=(SELECT|FIND)\b)/],beginScope:{1:"punctuation"},end:/\]/, | ||
endScope:"punctuation",scope:"soql",relevance:10,endsWithParent:!0,keywords:{ | ||
relevance:0,starts:F}],P={match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword", | ||
2:"variable"}},W={ | ||
keyword:[].concat(...v.keyword).concat("ABOVE_OR_BELOW","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","ASC","BY","CATEGORY","CONTAINS","CUSTOM","DATA","DESC","DIVISION","END","FIELDS","FIND","FROM","LAST","METADATA","NETWORK","ON","ORDER","RETURNING","ROLLUP","ROWS","SEARCH","SELECT","SNIPPET","SORT","SPELL_CORRECTION","STANDARD","USER_MODE","WHERE","PricebookId","WITH","SECURITY_ENFORCED","USING","SCOPE","Delegated","Everything","Mine","My_Territory","My_Team_Territory","Team","TYPEOF","ELSE","END","THEN","WHEN").concat("ABOVE","AND","AT","BY","CATEGORY","DATA","FIRST","FOR","GROUP","HAVING","IN","LAST","LIKE","LIMIT","LISTVIEW","NOT","NULLS","OFFSET","OR","REFERENCE","TRACKING","TYPEOF","UPDATE","UPDATE","VIEW","VIEWSTAT"), | ||
type:["AVG","convertCurrency","convertTimezone","COUNT_DISTINCT","COUNT","DISTANCE","EXCLUDES","FORMAT","GEOLOCATION","GROUP BY CUBE","GROUP BY ROLLUP","GROUPING","INCLUDES","MAX","MIN","SUM","toLabel"], | ||
"title.function":["DAY_IN_MONTH","HOUR_IN_DAY","DAY_IN_WEEK","DAY_IN_YEAR","DAY_ONLY","CALENDAR_MONTH","CALENDAR_QUARTER","CALENDAR_YEAR","FISCAL_MONTH","FISCAL_QUARTER","FISCAL_YEAR","TODAY","TOMORROW","YESTERDAY","WEEK_IN_MONTH","WEEK_IN_YEAR"], | ||
literal:v.literal,built_in:A},contains:[{begin:/\bSELECT\b/, | ||
beginScope:"keyword",end:/\bFROM\b/,returnEnd:!0,contains:[R,{ | ||
match:[/(?=[\s\,])/,a,/(?=[\s\,])/],scope:{2:"subst"}}]},{begin:[/\bFROM/,o,n], | ||
beginScope:{1:"keyword",3:"type"},end:/(?=\]|\s|\))/,contains:[{ | ||
match:[/(?<=\.)/,n],scope:{2:"type"}}]},{match:/:/,scope:"operator"},{ | ||
match:/(NEXT|LAST|THIS)_(90_DAY|DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S?\b/, | ||
scope:"keyword",relevance:10},{ | ||
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/], | ||
scope:{1:"keyword",2:"operator",3:"number"},relevance:10},{ | ||
match:[/(?<=:)/,/\s*/,a],scope:{3:"variable"}},r,k,L,T,R],illegal:"::"},P={ | ||
begin:[/\bfor\b\s*/,/\(/,a,o,a,/\s*/,/:/],beginScope:{3:"type",5:"variable", | ||
7:"operator"},end:/(?=\{)/,contains:[O,Y,k,{match:t.concat(a,/\b(?!\()/), | ||
scope:"variable"},{match:t.concat(n,s),scope:"title.function.invoke for_loop"},{ | ||
match:/\{/,endsParent:!0},L,r,R]};return{name:"Apex", | ||
literal:v.literal,built_in:S};return{name:"Apex", | ||
aliases:["apex","lightning","soql"],case_insensitive:!0,disableAutodetect:!1, | ||
ignoreIllegals:!1,keywords:v, | ||
illegal:["</","<#","<]","<div>","\x3c!--","!DOCTYPE",/<iframe\b/,/^#/,/^import \.[a-zA-Z]+\./,/^import [\w]+/,/^import$/,/^include </,/^use\s+</,/\b(const|var)\s+\w+\s*=/,/\bstruct\b/,"System.log","console.log",/\bfor\s+\w+\s+IN\s+/,/\bif\s+\w+\s+IN\s+/,/\bend\s+if\b/,/\bend\s+select\b/,/\b(int|var)\s+\w+\s+=/,/\b(int[0-9]+|bool)\b/,/\b\$/,"::=",/\s#[a-zA-Z]/,/\s_[a-zA-Z]/,/\s\$[a-zA-Z]/,"#if","%if",/\bif(?!\s+\()/,"%endif","#endif",/\w::\w/,/(SELECT|RETURNING)\s+\*/,/END\s+LOOP/,/CREATE\s+FUNCTION/,/\bint\b/,/import\s+\w+\s+=\s+require\("\w+"\)/,"/^include\b/",/\buse\s+strict\b/,/\w+\s+=\s+"\S*";/,/\/include\//,/\Anamespace\b/,/\bend(\.)?\n/,'"""',/\+\+\+/,/<%/,"<%#","%%>","<%%",":-",/\bmergesort\(/,/\bvar\s+env\b/,/\bdef\b\s\W:/,/"[^"]+"/], | ||
contains:[N,w,_,O,C,f,[{ | ||
match:[t.concat(/\b/,t.either(...d)),/\s+(?!\()/,t.optional(/as\s+(user|system)\b/)], | ||
scope:{3:"keyword"}},{begin:[/\bDatabase\b/,/\./,t.either(...d),s],beginScope:{ | ||
1:"built_in",2:"punctuation",3:"keyword invoke_database"},starts:U | ||
}],D,P,T,I,p,k,h,r,L,R,g,Y,F]}}})();hljs.registerLanguage("apex",e)})(); | ||
illegal:["</","<#","<]","<div>","\x3c!--","!DOCTYPE",/<iframe\b/,/^#/,/^import \.[a-zA-Z]+\./,/^import [\w]+/,/^import$/,/^include </,/^use\s+</,/\b(const|var)\s+\w+\s*=/,/\bstruct\b/,"System.log","console.log",/\bfor\s+\w+\s+IN\s+/,/\bif\s+\w+\s+IN\s+/,/\bend\s+if\b/,/\bend\s+select\b/,/\b(int|var)\s+\w+\s+=/,/\b(int[0-9]+|bool)\b/,/\b\$/,/\b_/,"::=",/\s#[a-zA-Z]/,/\s_[a-zA-Z]/,/\s\$[a-zA-Z]/,"#if","%if",/\bif(?!\s+\()/,"%endif","#endif","#_",/\d\s+\d/,/\w::\w/,/\bfloat\b/,/(SELECT|RETURNING)\s+\*/,/END\s+LOOP/,/CREATE\s+FUNCTION/,/\bint\b/,/import\s+\w+\s+=\s+require\("\w+"\)/,"/^include\b/",/\buse\s+strict\b/,/\w+\s+=\s+"\S*";/,/\/include\//,/\Anamespace\b/,/\bend(\.)?\n/,'"""',/\+\+\+/,/<%/,"<%#","%%>","<%%",":-",/\bmergesort\(/,/\bvar\s+env\b/,/\bdef\b\s\W:/,/"[^"]+"/,/\(\*|\*\)/], | ||
contains:[D,U,C,L,Y,[{match:/as\s+(user|system)\b/,scope:"keyword"}],r,I,{ | ||
match:[/\bfor\b\s*/,/\(/,a,o,a,/\s*/,/:/],scope:{3:"type",5:"variable", | ||
7:"operator"}},k,M,T,g,p,N,f,R,w,{begin:[/\[/,/\s*(?=(SELECT|FIND)\b)/], | ||
end:/\]/,beginScope:{1:"punctuation"},endScope:"punctuation",scope:"soql", | ||
relevance:10,endsWithParent:!0,keywords:W,contains:[{begin:/\bSELECT\b/, | ||
beginScope:"keyword",end:/\bFROM\b/,returnEnd:!0,keywords:W,contains:[A,{ | ||
match:[/(?=[\s\,])/,a,/(?=[\s\,])/],scope:{2:"subst"}}]},p,N,y,A,{match:/\(|\)/, | ||
scope:"punctuation",relevance:0},...r,{begin:[/\bFROM\b/,o],beginScope:{ | ||
1:"keyword"},end:/(?=\bWHERE\b|\]|\s|\))/,contains:[{match:a,scope:"type"},...r] | ||
},{ | ||
match:/(NEXT|LAST|THIS)_(90_DAY|DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S?\b/, | ||
scope:"keyword",relevance:8},{ | ||
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/], | ||
scope:{1:"keyword",2:"operator",3:"number"},relevance:8},{ | ||
match:[/(?<=:)/,/\s*/,n,/(?!\()/],scope:{3:"variable"},relevance:0},{ | ||
match:[/(?<=:|\.)/,a,/(?=\s*\()/],scope:{2:"title.function.invoke"},relevance:0 | ||
},{match:/:/,scope:"operator",relevance:0}],illegal:"::"},y,P,_]}}})() | ||
;hljs.registerLanguage("apex",e)})(); |
Large diffs are not rendered by default.
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