Skip to content

Commit 9598caa

Browse files
jf990joshgoebel
authored andcommitted
enh(arcade) Add missing keywords for Arcade v1.16
Signed-off-by: Josh Goebel <me@joshgoebel.com>
1 parent c88890c commit 9598caa

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ These changes should be for the better and should not be super noticeable but if
1515

1616
Grammars:
1717

18+
- enh(arcade) updated to ArcGIS Arcade version 1.16 [John Foster][]
1819
- enh(php) Left and right-side of double colon [Wojciech Kania][]
1920
- enh(php) add PHP constants [Wojciech Kania][]
2021
- enh(php) add PHP 8.1 keywords [Wojciech Kania][]
@@ -57,6 +58,7 @@ Themes:
5758

5859
- Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][]
5960

61+
[John Foster]: https://github.com/jf990
6062
[Pegasis]: https://github.com/PegasisForever
6163
[Wojciech Kania]: https://github.com/wkania
6264
[Jeylani B]: https://github.com/jeyllani

src/languages/arcade.js

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,30 @@ export default function(hljs) {
4242
built_in: [
4343
"Abs",
4444
"Acos",
45+
"All",
4546
"Angle",
46-
"Attachments",
47+
"Any",
4748
"Area",
4849
"AreaGeodetic",
50+
"Array",
4951
"Asin",
5052
"Atan",
5153
"Atan2",
54+
"Attachments",
5255
"Average",
56+
"Back",
5357
"Bearing",
5458
"Boolean",
5559
"Buffer",
5660
"BufferGeodetic",
5761
"Ceil",
5862
"Centroid",
5963
"Clip",
64+
"Concatenate",
6065
"Console",
6166
"Constrain",
6267
"Contains",
68+
"ConvertDirection",
6369
"Cos",
6470
"Count",
6571
"Crosses",
@@ -70,91 +76,152 @@ export default function(hljs) {
7076
"Day",
7177
"Decode",
7278
"DefaultValue",
79+
"Densify",
80+
"DensifyGeodetic",
7381
"Dictionary",
7482
"Difference",
7583
"Disjoint",
7684
"Distance",
7785
"DistanceGeodetic",
7886
"Distinct",
87+
"Domain",
7988
"DomainCode",
8089
"DomainName",
90+
"EnvelopeIntersects",
8191
"Equals",
92+
"Erase",
8293
"Exp",
94+
"Expects",
8395
"Extent",
8496
"Feature",
8597
"FeatureSet",
8698
"FeatureSetByAssociation",
8799
"FeatureSetById",
100+
"FeatureSetByName",
88101
"FeatureSetByPortalItem",
89102
"FeatureSetByRelationshipName",
90-
"FeatureSetByTitle",
91-
"FeatureSetByUrl",
92103
"Filter",
104+
"Find",
93105
"First",
94106
"Floor",
107+
"FromCharCode",
108+
"FromCodePoint",
109+
"FromJSON",
110+
"GdbVersion",
111+
"Generalize",
95112
"Geometry",
113+
"GetFeatureSet",
114+
"GetUser",
96115
"GroupBy",
97116
"Guid",
117+
"Hash",
98118
"HasKey",
99119
"Hour",
100120
"IIf",
121+
"Includes",
101122
"IndexOf",
123+
"Insert",
102124
"Intersection",
103125
"Intersects",
104126
"IsEmpty",
105127
"IsNan",
128+
"ISOMonth",
129+
"ISOWeek",
130+
"ISOWeekday",
131+
"ISOYear",
106132
"IsSelfIntersecting",
133+
"IsSimple",
134+
"Left|0",
107135
"Length",
136+
"Length3D",
108137
"LengthGeodetic",
109138
"Log",
139+
"Lower",
140+
"Map",
110141
"Max",
111142
"Mean",
143+
"Mid",
112144
"Millisecond",
113145
"Min",
114146
"Minute",
115147
"Month",
116148
"MultiPartToSinglePart",
117149
"Multipoint",
118150
"NextSequenceValue",
151+
"None",
119152
"Now",
120153
"Number",
154+
"Offset|0",
121155
"OrderBy",
122156
"Overlaps",
123157
"Point",
124158
"Polygon",
125159
"Polyline",
160+
"Pop",
126161
"Portal",
127162
"Pow",
163+
"Proper",
164+
"Push",
128165
"Random",
166+
"Reduce",
129167
"Relate",
168+
"Replace",
169+
"Resize",
130170
"Reverse",
131-
"RingIsClockWise",
171+
"Right|0",
172+
"RingIsClockwise",
173+
"Rotate",
132174
"Round",
175+
"Schema",
133176
"Second",
134177
"SetGeometry",
178+
"Simplify",
135179
"Sin",
180+
"Slice",
136181
"Sort",
182+
"Splice",
183+
"Split",
137184
"Sqrt",
138185
"Stdev",
186+
"SubtypeCode",
187+
"SubtypeName",
188+
"Subtypes",
139189
"Sum",
140190
"SymmetricDifference",
141191
"Tan",
142192
"Text",
143193
"Timestamp",
194+
"ToCharCode",
195+
"ToCodePoint",
144196
"Today",
197+
"ToHex",
145198
"ToLocal",
146-
"Top",
199+
"Top|0",
147200
"Touches",
148201
"ToUTC",
202+
"TrackAccelerationAt",
203+
"TrackAccelerationWindow",
204+
"TrackCurrentAcceleration",
205+
"TrackCurrentDistance",
206+
"TrackCurrentSpeed",
149207
"TrackCurrentTime",
208+
"TrackDistanceAt",
209+
"TrackDistanceWindow",
210+
"TrackDuration",
211+
"TrackFieldWindow",
150212
"TrackGeometryWindow",
151213
"TrackIndex",
214+
"TrackSpeedAt",
215+
"TrackSpeedWindow",
152216
"TrackStartTime",
153217
"TrackWindow",
218+
"Trim",
154219
"TypeOf",
155220
"Union",
221+
"Upper",
156222
"UrlEncode",
157223
"Variance",
224+
"Week",
158225
"Weekday",
159226
"When",
160227
"Within",
@@ -204,6 +271,7 @@ export default function(hljs) {
204271

205272
return {
206273
name: 'ArcGIS Arcade',
274+
case_insensitive: true,
207275
keywords: KEYWORDS,
208276
contains: [
209277
hljs.APOS_STRING_MODE,

test/markup/arcade/profile.expect.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/</span>
44
<span class="hljs-keyword">function</span> <span class="hljs-title function_">offsetPopulation</span>(<span class="hljs-params">offset</span>){
55
<span class="hljs-keyword">var</span> popDensity = <span class="hljs-built_in">Round</span>( <span class="hljs-symbol">$feature</span>.POPULATION / <span class="hljs-built_in">AreaGeodetic</span>(<span class="hljs-built_in">Geometry</span>(<span class="hljs-symbol">$feature</span>), <span class="hljs-string">&quot;square-kilometers&quot;</span>) );
6-
<span class="hljs-keyword">var</span> geom = <span class="hljs-built_in">Geometry</span>({ <span class="hljs-string">&#x27;x&#x27;</span>: offset.x, <span class="hljs-string">&#x27;y&#x27;</span>: offset.y, <span class="hljs-string">&#x27;spatialReference&#x27;</span>:{<span class="hljs-string">&#x27;wkid&#x27;</span>:<span class="hljs-number">102100</span>} });
6+
<span class="hljs-keyword">var</span> geom = <span class="hljs-built_in">Geometry</span>({ <span class="hljs-string">&#x27;x&#x27;</span>: <span class="hljs-built_in">offset</span>.x, <span class="hljs-string">&#x27;y&#x27;</span>: <span class="hljs-built_in">offset</span>.y, <span class="hljs-string">&#x27;spatialReference&#x27;</span>:{<span class="hljs-string">&#x27;wkid&#x27;</span>:<span class="hljs-number">102100</span>} });
77
<span class="hljs-keyword">var</span> myLayer = <span class="hljs-built_in">FeatureSet</span>(<span class="hljs-symbol">$map</span>, [<span class="hljs-string">&quot;POPULATION&quot;</span>, <span class="hljs-string">&quot;ELECTION-DATA&quot;</span>]);
88
<span class="hljs-keyword">return</span> popDensity;
99
}

0 commit comments

Comments
 (0)