Skip to content

Coverage

This page is generated with the reference. It states what the documentation does not cover, so a reader does not have to find the gap by a compilation.

Ranger has two operator mechanisms. A template operator holds one emission string per target language. A type method is Ranger code in an operator type:<T> block, and the compiler compiles it for the target like any other source, so it works wherever the library compiles.

Source File Template operators Type methods With an example
Core operators compiler/Lang.rgr 355 0 27
Standard operators and macros lib/stdops.rgr 2 0 0
stdlib.rgr lib/stdlib.rgr 11 38 8
JSON lib/JSON.rgr 36 2 0
Timers lib/Timers.rgr 6 0 0
Directory lib/ranger-dir.rgr 11 0 0

16 more operator sources stay in lib/ and have no page. No maintained program imports them. The generator skips them so a page does not present them as part of the maintained language.

A template is an implementation of the operator for that target language. An operator with the default template (*) writes the same code for every target that has no template of its own.

Target Own template Default template No template
JavaScript 196 200 25
TypeScript 196 200 25
Go 250 122 49
Rust 232 137 52
Python 220 149 52
Java 202 161 58
Kotlin 205 157 59
Dart 157 207 57
Swift 199 163 59
C# 195 173 53
C++ 230 152 39
PHP 174 178 69
Scala 148 160 113

The * template is also the JavaScript template of many operators. A target that has no template of its own then receives JavaScript in its output file, and the compilation reports success.

This is a scan of the template text for a construct that only JavaScript accepts, such as Math. or parseFloat(. It finds the common ones and not each one, so a count here is a lower limit.

Target Operators Names
Dart 1 int2double

Ranger 3.5.1 · commit f323fd4 · development build