]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/arcade.js
1 /*! `arcade` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
7 Language: ArcGIS Arcade
9 Website: https://developers.arcgis.com/arcade/
10 Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python
13 /** @type LanguageFn */
14 function arcade(hljs
) {
15 const regex
= hljs
.regex
;
16 const IDENT_RE
= '[A-Za-z_][0-9A-Za-z_]*';
104 "DistanceToCoordinate",
109 "EnvelopeIntersects",
118 "FeatureSetByAssociation",
121 "FeatureSetByPortalItem",
122 "FeatureSetByRelationshipClass",
123 "FeatureSetByRelationshipName",
125 "FilterBySubtypeCode",
158 "IsSelfIntersecting",
160 "KnowledgeGraphByPortalItem",
170 "MeasureToCoordinate",
176 "MultiPartToSinglePart",
217 "StandardizeFilename",
224 "SymmetricDifference",
239 "TrackAccelerationAt",
240 "TrackAccelerationWindow",
241 "TrackCurrentAcceleration",
242 "TrackCurrentDistance",
246 "TrackDistanceWindow",
249 "TrackGeometryWindow",
268 const PROFILE_VARS
= [
269 "aggregatedFeatures",
279 "fencenotificationtype",
305 begin: '\\$' + regex
.either(...PROFILE_VARS
)
310 { begin: '\\b(0[bB][01]+)' },
311 { begin: '\\b(0[oO][0-7]+)' },
312 { begin: hljs
.C_NUMBER_RE
}
321 contains: [] // defined later
323 const TEMPLATE_STRING
= {
328 hljs
.BACKSLASH_ESCAPE
,
333 hljs
.APOS_STRING_MODE
,
334 hljs
.QUOTE_STRING_MODE
,
339 const PARAMS_CONTAINS
= SUBST
.contains
.concat([
340 hljs
.C_BLOCK_COMMENT_MODE
,
341 hljs
.C_LINE_COMMENT_MODE
345 name: 'ArcGIS Arcade',
346 case_insensitive: true,
349 hljs
.APOS_STRING_MODE
,
350 hljs
.QUOTE_STRING_MODE
,
352 hljs
.C_LINE_COMMENT_MODE
,
353 hljs
.C_BLOCK_COMMENT_MODE
,
356 { // object attr container
361 begin: IDENT_RE
+ '\\s*:',
374 { // "value" container
375 begin: '(' + hljs
.RE_STARTERS_RE
+ '|\\b(return)\\b)\\s*',
378 hljs
.C_LINE_COMMENT_MODE
,
379 hljs
.C_BLOCK_COMMENT_MODE
,
382 className: 'function',
383 begin: '(\\(.*?\\)|' + IDENT_RE
+ ')\\s*=>',
391 { begin: /\(\s*\)/ },
398 contains: PARAMS_CONTAINS
408 beginKeywords: 'function',
412 hljs
.inherit(hljs
.TITLE_MODE
, {
413 className: "title.function",
422 contains: PARAMS_CONTAINS
437 hljs
.registerLanguage('arcade', hljsGrammar
);