Skip to content

Commit 195659e

Browse files
authored
enh(arcade) - update list of keywords, functions, and profile variables to match Arcade version 1.29 (#4181)
1 parent 13a96b0 commit 195659e

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CAVEATS / POTENTIALLY BREAKING CHANGES
88
Core Grammars:
99

1010
- fix(makefile) - allow strings inside `$()` expressions [aneesh98][]
11+
- enh(arcade) updated to ArcGIS Arcade version 1.29 [Kristian Ekenes][]
1112
- enh(css) add all properties listed on MDN (96 additions including `anchor-name`, `aspect-ratio`, `backdrop-filter`, `container`, `margin-trim`, `place-content`, `scroll-timeline`, ...) [BaliBalo][]
1213
- enh(erlang) OTP 27 triple-quoted strings [nixxquality][]
1314
- enh(erlang) OTP 27 doc attribute [nixxquality][]
@@ -87,6 +88,7 @@ CONTRIBUTORS
8788
[clsource]: https://github.com/clsource
8889
[Jake Leahy]: https://github.com/ire4ever1190
8990
[Laurel King]: https://github.com/laurelthorburn
91+
[Kristian Ekenes]: https://github.com/ekenes
9092

9193

9294
## Version 11.10.0

src/languages/arcade.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
22
Language: ArcGIS Arcade
33
Category: scripting
4-
Author: John Foster <[email protected]>
54
Website: https://developers.arcgis.com/arcade/
65
Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python
76
*/
@@ -26,6 +25,7 @@ export default function(hljs) {
2625
"import",
2726
"in",
2827
"new",
28+
"of",
2929
"return",
3030
"switch",
3131
"try",
@@ -96,6 +96,7 @@ export default function(hljs) {
9696
"Disjoint",
9797
"Distance",
9898
"DistanceGeodetic",
99+
"DistanceToCoordinate",
99100
"Distinct",
100101
"Domain",
101102
"DomainCode",
@@ -107,6 +108,7 @@ export default function(hljs) {
107108
"Expects",
108109
"Extent",
109110
"Feature",
111+
"FeatureInFilter",
110112
"FeatureSet",
111113
"FeatureSetByAssociation",
112114
"FeatureSetById",
@@ -115,6 +117,7 @@ export default function(hljs) {
115117
"FeatureSetByRelationshipClass",
116118
"FeatureSetByRelationshipName",
117119
"Filter",
120+
"FilterBySubtypeCode",
118121
"Find",
119122
"First|0",
120123
"Floor",
@@ -149,6 +152,7 @@ export default function(hljs) {
149152
"IsNan",
150153
"IsSelfIntersecting",
151154
"IsSimple",
155+
"KnowledgeGraphByPortalItem",
152156
"Left|0",
153157
"Length",
154158
"Length3D",
@@ -158,6 +162,7 @@ export default function(hljs) {
158162
"Map",
159163
"Max",
160164
"Mean",
165+
"MeasureToCoordinate",
161166
"Mid",
162167
"Millisecond",
163168
"Min",
@@ -175,13 +180,15 @@ export default function(hljs) {
175180
"OrderBy",
176181
"Overlaps",
177182
"Point",
183+
"PointToCoordinate",
178184
"Polygon",
179185
"Polyline",
180186
"Pop",
181187
"Portal",
182188
"Pow",
183189
"Proper",
184190
"Push",
191+
"QueryGraph",
185192
"Random",
186193
"Reduce",
187194
"Relate",
@@ -202,6 +209,7 @@ export default function(hljs) {
202209
"Splice",
203210
"Split",
204211
"Sqrt",
212+
"StandardizeFilename",
205213
"StandardizeGuid",
206214
"Stdev",
207215
"SubtypeCode",
@@ -264,6 +272,7 @@ export default function(hljs) {
264272
"feedfeature",
265273
"fencefeature",
266274
"fencenotificationtype",
275+
"graph",
267276
"join",
268277
"layer",
269278
"locationupdate",
@@ -281,7 +290,9 @@ export default function(hljs) {
281290
"targetdatastore",
282291
"targetfeature",
283292
"targetlayer",
293+
"userInput",
284294
"value",
295+
"variables",
285296
"view"
286297
];
287298
const SYMBOL = {

test/markup/arcade/profile.expect.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@
2525
}
2626
n+=i;
2727
}
28+
<span class="hljs-keyword">return</span> n;
2829

29-
<span class="hljs-keyword">return</span> n;
30+
<span class="hljs-keyword">var</span> a = [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>,<span class="hljs-number">10</span>];
31+
<span class="hljs-keyword">var</span> total = <span class="hljs-number">0</span>;
32+
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> v <span class="hljs-keyword">of</span> a) {
33+
total += v;
34+
}
35+
36+
<span class="hljs-keyword">var</span> result = <span class="hljs-built_in">DistanceToCoordinate</span>(<span class="hljs-symbol">$userInput</span>, <span class="hljs-number">1038</span>);
37+
38+
<span class="hljs-keyword">return</span> result.coordinate.x + total;

test/markup/arcade/profile.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@ for(var i=1; i<100; i++) {
2525
}
2626
n+=i;
2727
}
28+
return n;
2829

29-
return n;
30+
var a = [2,4,6,8,10];
31+
var total = 0;
32+
for (var v of a) {
33+
total += v;
34+
}
35+
36+
var result = DistanceToCoordinate($userInput, 1038);
37+
38+
return result.coordinate.x + total;

0 commit comments

Comments
 (0)