Skip to content

Commit

Permalink
enh(arcade) Add missing keywords for Arcade v1.16
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Goebel <me@joshgoebel.com>
  • Loading branch information
jf990 authored and joshgoebel committed Jan 5, 2022
1 parent c88890c commit 9598caa
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -15,6 +15,7 @@ These changes should be for the better and should not be super noticeable but if

Grammars:

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

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

[John Foster]: https://github.com/jf990
[Pegasis]: https://github.com/PegasisForever
[Wojciech Kania]: https://github.com/wkania
[Jeylani B]: https://github.com/jeyllani
Expand Down
78 changes: 73 additions & 5 deletions src/languages/arcade.js
Expand Up @@ -42,24 +42,30 @@ export default function(hljs) {
built_in: [
"Abs",
"Acos",
"All",
"Angle",
"Attachments",
"Any",
"Area",
"AreaGeodetic",
"Array",
"Asin",
"Atan",
"Atan2",
"Attachments",
"Average",
"Back",
"Bearing",
"Boolean",
"Buffer",
"BufferGeodetic",
"Ceil",
"Centroid",
"Clip",
"Concatenate",
"Console",
"Constrain",
"Contains",
"ConvertDirection",
"Cos",
"Count",
"Crosses",
Expand All @@ -70,91 +76,152 @@ export default function(hljs) {
"Day",
"Decode",
"DefaultValue",
"Densify",
"DensifyGeodetic",
"Dictionary",
"Difference",
"Disjoint",
"Distance",
"DistanceGeodetic",
"Distinct",
"Domain",
"DomainCode",
"DomainName",
"EnvelopeIntersects",
"Equals",
"Erase",
"Exp",
"Expects",
"Extent",
"Feature",
"FeatureSet",
"FeatureSetByAssociation",
"FeatureSetById",
"FeatureSetByName",
"FeatureSetByPortalItem",
"FeatureSetByRelationshipName",
"FeatureSetByTitle",
"FeatureSetByUrl",
"Filter",
"Find",
"First",
"Floor",
"FromCharCode",
"FromCodePoint",
"FromJSON",
"GdbVersion",
"Generalize",
"Geometry",
"GetFeatureSet",
"GetUser",
"GroupBy",
"Guid",
"Hash",
"HasKey",
"Hour",
"IIf",
"Includes",
"IndexOf",
"Insert",
"Intersection",
"Intersects",
"IsEmpty",
"IsNan",
"ISOMonth",
"ISOWeek",
"ISOWeekday",
"ISOYear",
"IsSelfIntersecting",
"IsSimple",
"Left|0",
"Length",
"Length3D",
"LengthGeodetic",
"Log",
"Lower",
"Map",
"Max",
"Mean",
"Mid",
"Millisecond",
"Min",
"Minute",
"Month",
"MultiPartToSinglePart",
"Multipoint",
"NextSequenceValue",
"None",
"Now",
"Number",
"Offset|0",
"OrderBy",
"Overlaps",
"Point",
"Polygon",
"Polyline",
"Pop",
"Portal",
"Pow",
"Proper",
"Push",
"Random",
"Reduce",
"Relate",
"Replace",
"Resize",
"Reverse",
"RingIsClockWise",
"Right|0",
"RingIsClockwise",
"Rotate",
"Round",
"Schema",
"Second",
"SetGeometry",
"Simplify",
"Sin",
"Slice",
"Sort",
"Splice",
"Split",
"Sqrt",
"Stdev",
"SubtypeCode",
"SubtypeName",
"Subtypes",
"Sum",
"SymmetricDifference",
"Tan",
"Text",
"Timestamp",
"ToCharCode",
"ToCodePoint",
"Today",
"ToHex",
"ToLocal",
"Top",
"Top|0",
"Touches",
"ToUTC",
"TrackAccelerationAt",
"TrackAccelerationWindow",
"TrackCurrentAcceleration",
"TrackCurrentDistance",
"TrackCurrentSpeed",
"TrackCurrentTime",
"TrackDistanceAt",
"TrackDistanceWindow",
"TrackDuration",
"TrackFieldWindow",
"TrackGeometryWindow",
"TrackIndex",
"TrackSpeedAt",
"TrackSpeedWindow",
"TrackStartTime",
"TrackWindow",
"Trim",
"TypeOf",
"Union",
"Upper",
"UrlEncode",
"Variance",
"Week",
"Weekday",
"When",
"Within",
Expand Down Expand Up @@ -204,6 +271,7 @@ export default function(hljs) {

return {
name: 'ArcGIS Arcade',
case_insensitive: true,
keywords: KEYWORDS,
contains: [
hljs.APOS_STRING_MODE,
Expand Down
2 changes: 1 addition & 1 deletion test/markup/arcade/profile.expect.txt
Expand Up @@ -3,7 +3,7 @@
*/</span>
<span class="hljs-keyword">function</span> <span class="hljs-title function_">offsetPopulation</span>(<span class="hljs-params">offset</span>){
<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>) );
<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>} });
<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>} });
<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>]);
<span class="hljs-keyword">return</span> popDensity;
}

0 comments on commit 9598caa

Please sign in to comment.