ranger-compiler 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,27 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [3.4.0] - 2026-09-16
11
-
12
- The last package on npm was **3.2.0**. 3.2.1, 3.3.0 and 3.3.1 were
13
- already dated in this file and never published there, so this tarball
14
- is the first that carries them.
15
-
16
- On the compiler: generic classes (`class History @params(Op)`),
17
- expanded into ordinary classes before any writer runs; a dotted call
18
- in return position now parses (`return this.helper()`); Swift string
19
- operators walk UTF-16 in amortised constant time; Kotlin emits
20
- `open class` for the header form of inheritance; a Python empty
21
- constructor writes `pass`; the C++ `Any` union only names classes the
22
- program actually emits. The TypeScript module build type-checks: a
23
- `sort` comparator in the serializer used `forEach`, which the ES6
24
- writer emits as `async`, and `Array.sort` will not take a
25
- `Promise<number>`. `npm run test:publish` skips the JS-engine
26
- conformance suites (they are not the published compiler) and runs each
27
- file in its own fork so a two-minute `shapes` run cannot starve the
28
- reporter. The gallery grew in the same window — EVG, Office,
29
- the book engine, Mermaid, Figma — and is not in the npm tarball.
30
-
31
10
  - **All thirty-eight of Mermaid's header keywords are drawn.** The matrix in
32
11
  `docs/MERMAID_PARITY.md` is read off Mermaid's own detector registry — the
33
12
  record its parser itself consults. It used to say thirty of thirty, and both
@@ -40,10 +19,12 @@ the book engine, Mermaid, Figma — and is not in the npm tarball.
40
19
  token is a coloured speck, the slider is the viewport, a problem is a tick,
41
20
  and a click or a drag there jumps the view without moving the caret. The
42
21
  picture keeps a compact scale (two pixels a line, shrinking only when the
43
- file would not fit); the pointer's place on that picture, as a fraction of
44
- its height, is how far the editor scrolls. On r5 a finger on the strip
45
- stays a pointer, not a line-by-line flick. A panel too narrow to spare
46
- the strip hides it. The same map shows on the r5 page, on the light theme.
22
+ file would not fit); each letter is a faint cell at the opacity of its
23
+ glyph (~3 % for `.`, ~10 % for `I`, ~20 % for `R`) rather than a solid
24
+ bar. The pointer's place on that picture, as a fraction of its height,
25
+ is how far the editor scrolls. On r5 a finger on the strip stays a
26
+ pointer, not a line-by-line flick. A panel too narrow to spare the strip
27
+ hides it. The same map shows on the r5 page, on the light theme.
47
28
 
48
29
  - **FigJam boards draw.** A sticky, a shape with text, a connector and a table
49
30
  carry no children: Figma builds their layers itself and a `.jam` ships only
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ranger cross language compiler
2
2
 
3
- **Version 3.4.0** | Status: `experimental`
3
+ **Version 3.3.0** | Status: `experimental`
4
4
 
5
5
  **Licensing:** Ranger-authored compiler and language sources are MIT licensed,
6
6
  unless a file says otherwise. Ranger-authored applications and technology
@@ -78,7 +78,8 @@ host.notifyPath = (path) => { /* sync view model + re-render */ };
78
78
  ## Where To Start
79
79
 
80
80
  - [Documentation site](https://terotests.github.io/Ranger/docs/) — install, first program, types, optionals, and the **generated operator reference** (838 operators, compiled from the sources of the commit that publishes the site, so it cannot drift)
81
- - [Online playground](https://terotests.github.io/Ranger/) — try Ranger in the browser (`playground/`, Vite + current compiler)
81
+ - [The front page](https://terotests.github.io/Ranger/) — what Ranger is, the targets, the platforms and the gallery (`landing/`)
82
+ - [Online playground](https://terotests.github.io/Ranger/playground/) — try Ranger in the browser (`playground/`, Vite + current compiler)
82
83
  - `README.md` - language overview, installation, and syntax notes
83
84
  - [`gallery/README.md`](gallery/README.md) - index of the application stack (AGPL): EVG, Office, DataGrid, parsers, games, and `@process` host apps
84
85
  - [`LICENSING.md`](LICENSING.md) - MIT compiler vs AGPL gallery
package/dist/api.d.ts CHANGED
@@ -1697,7 +1697,9 @@ export declare class PkgImport {
1697
1697
  static walkUp(env: InputEnv, start: string): string;
1698
1698
  static readText(env: InputEnv, dir: string, name: string): Promise<string>;
1699
1699
  static findChar(s: string, code: number): number;
1700
+ static manifestChain(env: InputEnv, startDir: string, libraryPaths: Array<string>): Array<string>;
1700
1701
  static resolve(env: InputEnv, startDir: string, spec: string, libraryPaths: Array<string>): Promise<PkgHit>;
1702
+ static resolveIn(env: InputEnv, manDir: string, spec: string): Promise<PkgHit>;
1701
1703
  static lockRoot(env: InputEnv, lockText: string, pkgName: string, manDir: string): string;
1702
1704
  }
1703
1705
  export declare class ClassJoinPoint {
@@ -3704,6 +3706,396 @@ export declare class CLIProgress {
3704
3706
  printFlag(flag: string, description: string): void;
3705
3707
  printSection(title: string): void;
3706
3708
  }
3709
+ export declare class GitSha1 {
3710
+ constructor();
3711
+ static mask32(): number;
3712
+ static add32(a: number, b: number): number;
3713
+ static not32(x: number): number;
3714
+ static rotl(x: number, n: number): number;
3715
+ static copyRange(data: Uint8Array, start: number, count: number): Uint8Array;
3716
+ static ascii(data: Uint8Array, start: number, count: number): string;
3717
+ static u32be(data: Uint8Array, i: number): number;
3718
+ static hexDigit(d: number): string;
3719
+ static toHex(data: Uint8Array): string;
3720
+ static fromHex(hex: string): Uint8Array;
3721
+ static hash(data: Uint8Array): Uint8Array;
3722
+ static writeU32be(out: Uint8Array, i: number, v: number): void;
3723
+ static hashHex(data: Uint8Array): string;
3724
+ static objectId(kind: string, payload: Uint8Array): string;
3725
+ static hexEq(a: string, b: string): boolean;
3726
+ }
3727
+ export declare class GitPkt {
3728
+ ok: boolean;
3729
+ err: string;
3730
+ lines: Array<string>;
3731
+ raw: Array<Uint8Array>;
3732
+ isFlush: Array<boolean>;
3733
+ constructor();
3734
+ }
3735
+ export declare class GitRef {
3736
+ name: string;
3737
+ sha: string;
3738
+ peeled: string;
3739
+ constructor();
3740
+ }
3741
+ export declare class GitAdvertisement {
3742
+ ok: boolean;
3743
+ err: string;
3744
+ service: string;
3745
+ caps: string;
3746
+ head: string;
3747
+ refs: Array<GitRef>;
3748
+ constructor();
3749
+ }
3750
+ export declare class GitWant {
3751
+ ok: boolean;
3752
+ err: string;
3753
+ sha: string;
3754
+ body: Uint8Array;
3755
+ constructor();
3756
+ }
3757
+ export declare class GitSideband {
3758
+ ok: boolean;
3759
+ err: string;
3760
+ pack: Uint8Array;
3761
+ progress: string;
3762
+ constructor();
3763
+ }
3764
+ export declare class GitPktIO {
3765
+ constructor();
3766
+ static hexVal(ch: string): number;
3767
+ static parseHex4(data: Uint8Array, at: number): number;
3768
+ static hex4(n: number): string;
3769
+ static encodeLine(text: string): Uint8Array;
3770
+ static encodeFlush(): Uint8Array;
3771
+ static parse(data: Uint8Array): GitPkt;
3772
+ static parseAdvertisement(data: Uint8Array): GitAdvertisement;
3773
+ static findRef(adv: GitAdvertisement, spec: string): string;
3774
+ static hasToken(caps: string, name: string): boolean;
3775
+ static joinBuf(parts: Array<Uint8Array>): Uint8Array;
3776
+ static encodeDelim(): Uint8Array;
3777
+ static buildWant(adv: GitAdvertisement, spec: string): GitWant;
3778
+ static buildWantFetch(sha: string, deepen: number, filter: string, extras: Array<string>): GitWant;
3779
+ static buildWantTrees(adv: GitAdvertisement, spec: string): GitWant;
3780
+ static buildWantSha(sha: string): GitWant;
3781
+ static buildFetchV2(sha: string, deepen: number, filter: string): GitWant;
3782
+ static demux(data: Uint8Array): GitSideband;
3783
+ static indexOfPack(data: Uint8Array): number;
3784
+ static indexOfChar(s: string, code: number): number;
3785
+ static trimNl(s: string): string;
3786
+ }
3787
+ export declare class ZipBuffer {
3788
+ data: Uint8Array;
3789
+ pos: number;
3790
+ length: number;
3791
+ constructor();
3792
+ initWithBuffer(buf: Uint8Array): void;
3793
+ initWithSize(size: number): void;
3794
+ getPosition(): number;
3795
+ setPosition(newPos: number): void;
3796
+ seek(offset: number): void;
3797
+ skip(count: number): void;
3798
+ remaining(): number;
3799
+ isEOF(): boolean;
3800
+ readUint8(): number;
3801
+ readUint16LE(): number;
3802
+ readUint32LE(): number;
3803
+ readBytes(count: number): Uint8Array;
3804
+ readString(count: number): string;
3805
+ peekUint8(): number;
3806
+ peekUint32LE(): number;
3807
+ writeUint8(value: number): void;
3808
+ writeUint16LE(value: number): void;
3809
+ writeUint32LE(value: number): void;
3810
+ writeBytes(src: Uint8Array, srcOffset: number, count: number): void;
3811
+ writeBuffer(src: Uint8Array): void;
3812
+ writeString(s: string): void;
3813
+ getBuffer(): Uint8Array;
3814
+ getLength(): number;
3815
+ findSignatureBackward(sig: number, startPos: number): number;
3816
+ }
3817
+ export declare class GrowableZipBuffer {
3818
+ chunks: Array<Uint8Array>;
3819
+ chunkLens: Array<number>;
3820
+ chunkSize: number;
3821
+ currentChunk: Uint8Array;
3822
+ currentPos: number;
3823
+ totalSize: number;
3824
+ constructor();
3825
+ setChunkSize(size: number): void;
3826
+ allocateNewChunk(): void;
3827
+ writeUint8(value: number): void;
3828
+ writeUint16LE(value: number): void;
3829
+ writeUint32LE(value: number): void;
3830
+ writeBytes(src: Uint8Array, srcOffset: number, count: number): void;
3831
+ writeBuffer(src: Uint8Array): void;
3832
+ writeString(s: string): void;
3833
+ getSize(): number;
3834
+ toBuffer(): Uint8Array;
3835
+ }
3836
+ export declare class InflateHuffmanTable {
3837
+ counts: Array<number>;
3838
+ symbols: Array<number>;
3839
+ maxBits: number;
3840
+ constructor();
3841
+ build(lengths: Array<number>, numSymbols: number): void;
3842
+ decode(reader: InflateBitReader): number;
3843
+ }
3844
+ export declare class InflateBitReader {
3845
+ data: Uint8Array;
3846
+ bytePos: number;
3847
+ bitPos: number;
3848
+ currentByte: number;
3849
+ dataLength: number;
3850
+ constructor();
3851
+ init(buf: Uint8Array, offset: number, length: number): void;
3852
+ readBit(): number;
3853
+ readBits(count: number): number;
3854
+ alignToByte(): void;
3855
+ readByte(): number;
3856
+ readUint16LE(): number;
3857
+ getBytePosition(): number;
3858
+ isEOF(): boolean;
3859
+ }
3860
+ export declare class Inflate {
3861
+ input: Uint8Array;
3862
+ reader: InflateBitReader;
3863
+ outBuf: Uint8Array;
3864
+ outLen: number;
3865
+ outCap: number;
3866
+ fixedLitLen: InflateHuffmanTable;
3867
+ fixedDist: InflateHuffmanTable;
3868
+ fixedTablesBuilt: boolean;
3869
+ lengthBase: Array<number>;
3870
+ lengthExtra: Array<number>;
3871
+ distBase: Array<number>;
3872
+ distExtra: Array<number>;
3873
+ constructor();
3874
+ resetOutput(hint: number): void;
3875
+ ensureCapacity(extra: number): void;
3876
+ pushByte(b: number): void;
3877
+ finalOutput(): Uint8Array;
3878
+ buildLengthDistTables(): void;
3879
+ buildFixedTables(): void;
3880
+ decompress(data: Uint8Array): Uint8Array;
3881
+ decompressFrom(data: Uint8Array, offset: number): Uint8Array;
3882
+ inputPos(): number;
3883
+ decompressStored(): void;
3884
+ decompressHuffman(litLenTable: InflateHuffmanTable, distTable: InflateHuffmanTable): void;
3885
+ decompressDynamic(): void;
3886
+ copyFromOutput(distance: number, length: number): void;
3887
+ }
3888
+ export declare class GitZlib {
3889
+ ok: boolean;
3890
+ err: string;
3891
+ nextPos: number;
3892
+ constructor();
3893
+ inflateAt(data: Uint8Array, offset: number): Uint8Array;
3894
+ inflate(data: Uint8Array): Uint8Array;
3895
+ }
3896
+ export declare class GitObj {
3897
+ kind: number;
3898
+ sha: string;
3899
+ data: Uint8Array;
3900
+ packOff: number;
3901
+ resolved: boolean;
3902
+ delta: boolean;
3903
+ baseOff: number;
3904
+ baseSha: string;
3905
+ constructor();
3906
+ }
3907
+ export declare class GitPack {
3908
+ ok: boolean;
3909
+ err: string;
3910
+ version: number;
3911
+ count: number;
3912
+ objects: Array<GitObj>;
3913
+ bySha: {
3914
+ [key: string]: GitObj;
3915
+ };
3916
+ byOff: {
3917
+ [key: number]: GitObj;
3918
+ };
3919
+ constructor();
3920
+ }
3921
+ export declare class GitDelta {
3922
+ constructor();
3923
+ static varInt(data: Uint8Array, pos: Array<number>): number;
3924
+ static apply(src: Uint8Array, delta: Uint8Array): Uint8Array;
3925
+ }
3926
+ export declare class GitPackIO {
3927
+ constructor();
3928
+ static kindName(kind: number): string;
3929
+ static parse(data: Uint8Array): GitPack;
3930
+ static resolveDeltas(pack: GitPack): void;
3931
+ static lookup(pack: GitPack, sha: string): GitObj | undefined;
3932
+ static merge(a: GitPack, b: GitPack): GitPack;
3933
+ }
3934
+ export declare class GitEntry {
3935
+ name: string;
3936
+ sha: string;
3937
+ isTree: boolean;
3938
+ mode: string;
3939
+ constructor();
3940
+ }
3941
+ export declare class GitFile {
3942
+ path: string;
3943
+ data: Uint8Array;
3944
+ constructor();
3945
+ }
3946
+ export declare class GitTree {
3947
+ sha: string;
3948
+ entries: Array<GitEntry>;
3949
+ constructor();
3950
+ }
3951
+ export declare class GitMem {
3952
+ files: Array<GitFile>;
3953
+ paths: Array<string>;
3954
+ byPath: {
3955
+ [key: string]: GitFile;
3956
+ };
3957
+ constructor();
3958
+ }
3959
+ export declare class GitStore {
3960
+ pack: GitPack;
3961
+ ok: boolean;
3962
+ err: string;
3963
+ constructor(p: GitPack);
3964
+ takeObj(sha: string): GitObj | undefined;
3965
+ parseTree(payload: Uint8Array): GitTree;
3966
+ commitTree(payload: Uint8Array): string;
3967
+ checkout(sha: string, subdir: string): GitMem;
3968
+ walk(mem: GitMem, treeSha: string, prefix: string, want: string): void;
3969
+ mayEnter(path: string, want: string): boolean;
3970
+ splitSegs(path: string): Array<string>;
3971
+ asTreeSha(sha: string): string;
3972
+ treeAt(sha: string, subdir: string): string;
3973
+ underSubdir(path: string, want: string): boolean;
3974
+ stripSubdir(path: string, want: string): string;
3975
+ baseName(path: string): string;
3976
+ writeDisk(mem: GitMem, root: string): void;
3977
+ dirOf(path: string): string;
3978
+ splitPath(path: string): Array<string>;
3979
+ fileText(mem: GitMem, path: string): string;
3980
+ }
3981
+ export declare class PkgVal {
3982
+ kind: string;
3983
+ str: string;
3984
+ num: number;
3985
+ flag: boolean;
3986
+ keys: Array<string>;
3987
+ vals: Array<PkgVal>;
3988
+ constructor();
3989
+ }
3990
+ export declare class PkgJson {
3991
+ text: string;
3992
+ i: number;
3993
+ n: number;
3994
+ ok: boolean;
3995
+ err: string;
3996
+ constructor();
3997
+ parse(src: string): PkgVal;
3998
+ skip(): void;
3999
+ value(): PkgVal;
4000
+ object(): PkgVal;
4001
+ str(): string;
4002
+ num(): number;
4003
+ static child(obj: PkgVal, key: string): PkgVal | undefined;
4004
+ static strOf(obj: PkgVal, key: string): string;
4005
+ static intOf(obj: PkgVal, key: string): number;
4006
+ }
4007
+ export declare class PkgDep {
4008
+ name: string;
4009
+ path: string;
4010
+ git: string;
4011
+ rev: string;
4012
+ tag: string;
4013
+ subdir: string;
4014
+ constructor();
4015
+ }
4016
+ export declare class PkgManifest {
4017
+ name: string;
4018
+ version: string;
4019
+ entry: string;
4020
+ license: string;
4021
+ deps: Array<PkgDep>;
4022
+ ok: boolean;
4023
+ err: string;
4024
+ constructor();
4025
+ }
4026
+ export declare class PkgLockEnt {
4027
+ name: string;
4028
+ path: string;
4029
+ git: string;
4030
+ rev: string;
4031
+ subdir: string;
4032
+ sha256: string;
4033
+ constructor();
4034
+ }
4035
+ export declare class PkgLock {
4036
+ lockVersion: number;
4037
+ packages: Array<PkgLockEnt>;
4038
+ ok: boolean;
4039
+ err: string;
4040
+ constructor();
4041
+ }
4042
+ export declare class PkgManifestIO {
4043
+ constructor();
4044
+ static load(src: string): PkgManifest;
4045
+ static loadLock(src: string): PkgLock;
4046
+ static escape(s: string): string;
4047
+ static dumpLock(lock: PkgLock): string;
4048
+ static dumpManifest(m: PkgManifest): string;
4049
+ }
4050
+ export declare class PkgCache {
4051
+ constructor();
4052
+ static lessStr(a: string, b: string): boolean;
4053
+ static hashMem(mem: GitMem): string;
4054
+ static put(mem: GitMem, cacheRoot: string): string;
4055
+ static lockFor(name: string, git: string, rev: string, subdir: string, hash: string): PkgLockEnt;
4056
+ }
4057
+ export declare class PkgFetchWork {
4058
+ dir: string;
4059
+ man: PkgManifest;
4060
+ git: string;
4061
+ rev: string;
4062
+ subdir: string;
4063
+ fromGit: boolean;
4064
+ constructor();
4065
+ }
4066
+ export declare class PkgFetch {
4067
+ ok: boolean;
4068
+ err: string;
4069
+ cacheRoot: string;
4070
+ cacheOverride: string;
4071
+ rootDir: string;
4072
+ tmpRoot: string;
4073
+ httpTool: string;
4074
+ vendor: boolean;
4075
+ frozen: boolean;
4076
+ force: boolean;
4077
+ lock: PkgLock;
4078
+ previous: PkgLock;
4079
+ seen: {
4080
+ [key: string]: boolean;
4081
+ };
4082
+ lastRev: string;
4083
+ lastMem: GitMem;
4084
+ constructor();
4085
+ runHttp(args: Array<string>): boolean;
4086
+ advertise(url: string, dest: string): boolean;
4087
+ post(url: string, body: string, dest: string): boolean;
4088
+ fetchInto(name: string, url: string, wantRev: string, subdir: string): string;
4089
+ storeMem(mem: GitMem): string;
4090
+ cachedFor(env: InputEnv, name: string, git: string, rev: string, subdir: string): string;
4091
+ install(env: InputEnv, manDir: string): Promise<boolean>;
4092
+ oneDep(env: InputEnv, pending: Array<PkgFetchWork>, w: PkgFetchWork, d: PkgDep): Promise<boolean>;
4093
+ static findHttpTool(env: InputEnv): string;
4094
+ static splitPath(path: string): Array<string>;
4095
+ static readBytes(path: string): Uint8Array;
4096
+ static writeBytes(path: string, data: Uint8Array): void;
4097
+ static loadPack(path: string): GitPack;
4098
+ }
3707
4099
  export declare class RangerDocGenerator {
3708
4100
  constructor();
3709
4101
  writeTypeDef(item: CodeNode, ctx: RangerAppWriterContext, wr: CodeWriter): Promise<void>;
@@ -3863,6 +4255,7 @@ export declare class VirtualCompiler {
3863
4255
  fillStr(cnt: number): string;
3864
4256
  detectLanguageFromExtension(filename: string): string;
3865
4257
  isTypeScriptExtension(filename: string): boolean;
4258
+ runInstall(env: InputEnv, params: CmdParams, cli: CLIProgress): Promise<boolean>;
3866
4259
  run(env: InputEnv): Promise<CompilerResults>;
3867
4260
  static create_env(): Promise<void>;
3868
4261
  static displayCompilerErrorsWithCLI(appCtx: RangerAppWriterContext, cli: CLIProgress): void;