aontu 0.3.0 → 0.6.1
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/aontu.ts +3 -2
- package/dist/aontu.d.ts +2 -2
- package/dist/aontu.js +3 -4
- package/dist/aontu.js.map +1 -1
- package/dist/aontu.min.js +1 -63
- package/dist/lib/lang.d.ts +1 -3
- package/dist/lib/lang.js +47 -30
- package/dist/lib/lang.js.map +1 -1
- package/dist/lib/op/disjunct.js +10 -10
- package/dist/lib/op/disjunct.js.map +1 -1
- package/dist/lib/op/op.d.ts +1 -1
- package/dist/lib/op/op.js.map +1 -1
- package/dist/lib/op/unite.js +19 -14
- package/dist/lib/op/unite.js.map +1 -1
- package/dist/lib/type.d.ts +33 -22
- package/dist/lib/type.js +22 -76
- package/dist/lib/type.js.map +1 -1
- package/dist/lib/unify.d.ts +4 -1
- package/dist/lib/unify.js +7 -5
- package/dist/lib/unify.js.map +1 -1
- package/dist/lib/val/ConjunctVal.d.ts +12 -0
- package/dist/lib/val/ConjunctVal.js +191 -0
- package/dist/lib/val/ConjunctVal.js.map +1 -0
- package/dist/lib/val/DisjunctVal.d.ts +12 -0
- package/dist/lib/val/DisjunctVal.js +85 -0
- package/dist/lib/val/DisjunctVal.js.map +1 -0
- package/dist/lib/val/ListVal.d.ts +14 -0
- package/dist/lib/val/ListVal.js +91 -0
- package/dist/lib/val/ListVal.js.map +1 -0
- package/dist/lib/val/MapVal.d.ts +14 -0
- package/dist/lib/val/MapVal.js +141 -0
- package/dist/lib/val/MapVal.js.map +1 -0
- package/dist/lib/val/Nil.d.ts +15 -0
- package/dist/lib/val/Nil.js +54 -0
- package/dist/lib/val/Nil.js.map +1 -0
- package/dist/lib/val/PrefVal.d.ts +12 -0
- package/dist/lib/val/PrefVal.js +60 -0
- package/dist/lib/val/PrefVal.js.map +1 -0
- package/dist/lib/val/RefVal.d.ts +15 -0
- package/dist/lib/val/RefVal.js +73 -0
- package/dist/lib/val/RefVal.js.map +1 -0
- package/dist/lib/val/ValBase.d.ts +22 -0
- package/dist/lib/val/ValBase.js +25 -0
- package/dist/lib/val/ValBase.js.map +1 -0
- package/dist/lib/val.d.ts +5 -90
- package/dist/lib/val.js +13 -593
- package/dist/lib/val.js.map +1 -1
- package/lib/lang.ts +77 -59
- package/lib/op/disjunct.ts +14 -8
- package/lib/op/op.ts +2 -1
- package/lib/op/unite.ts +14 -12
- package/lib/type.ts +104 -0
- package/lib/unify.ts +10 -8
- package/lib/val/ConjunctVal.ts +284 -0
- package/lib/val/DisjunctVal.ts +145 -0
- package/lib/val/ListVal.ts +154 -0
- package/lib/val/MapVal.ts +226 -0
- package/lib/val/Nil.ts +94 -0
- package/lib/val/PrefVal.ts +113 -0
- package/lib/val/RefVal.ts +126 -0
- package/lib/val/RefVal.ts~ +319 -0
- package/lib/val/ValBase.ts +76 -0
- package/lib/val.ts +15 -802
- package/package.json +27 -23
- package/lib/common.ts +0 -19
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2021-2022 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ValBase = void 0;
|
|
5
|
+
const lang_1 = require("../lang");
|
|
6
|
+
class ValBase {
|
|
7
|
+
constructor(peg, ctx) {
|
|
8
|
+
this.done = 0;
|
|
9
|
+
this.row = -1;
|
|
10
|
+
this.col = -1;
|
|
11
|
+
this.url = '';
|
|
12
|
+
this.peg = peg;
|
|
13
|
+
this.path = (ctx && ctx.path) || [];
|
|
14
|
+
this.id = (ctx && ctx.vc++) || (9e9 + Math.floor(Math.random() * (1e9)));
|
|
15
|
+
}
|
|
16
|
+
same(peer) {
|
|
17
|
+
// return this === peer
|
|
18
|
+
return null == peer ? false : this.id === peer.id;
|
|
19
|
+
}
|
|
20
|
+
get site() {
|
|
21
|
+
return new lang_1.Site(this);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ValBase = ValBase;
|
|
25
|
+
//# sourceMappingURL=ValBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValBase.js","sourceRoot":"","sources":["../../../lib/val/ValBase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAkBzD,kCAEgB;AAWhB,MAAe,OAAO;IAiBpB,YAAY,GAAS,EAAE,GAAa;QAfpC,SAAI,GAAW,CAAC,CAAA;QAEhB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,EAAE,CAAA;QAYd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QACnC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,uBAAuB;QACvB,OAAO,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAA;IACnD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,WAAI,CAAC,IAAI,CAAC,CAAA;IACvB,CAAC;CAOF;AAMC,0BAAO"}
|
package/dist/lib/val.d.ts
CHANGED
|
@@ -1,51 +1,17 @@
|
|
|
1
|
+
import type { Val } from './type';
|
|
1
2
|
import { Context } from './unify';
|
|
2
|
-
import {
|
|
3
|
-
declare type ValMap = {
|
|
4
|
-
[key: string]: Val;
|
|
5
|
-
};
|
|
6
|
-
declare type ValList = Val[];
|
|
7
|
-
declare const DONE = -1;
|
|
8
|
-
declare const TOP: Val;
|
|
9
|
-
declare abstract class Val {
|
|
10
|
-
id: number;
|
|
11
|
-
done: number;
|
|
12
|
-
path: string[];
|
|
13
|
-
row: number;
|
|
14
|
-
col: number;
|
|
15
|
-
url: string;
|
|
16
|
-
top?: boolean;
|
|
17
|
-
peg?: any;
|
|
18
|
-
err?: any[];
|
|
19
|
-
deps?: any;
|
|
20
|
-
constructor(peg?: any, ctx?: Context);
|
|
21
|
-
same(peer: Val): boolean;
|
|
22
|
-
get site(): Site;
|
|
23
|
-
abstract unify(peer: Val, ctx: Context): Val;
|
|
24
|
-
abstract get canon(): string;
|
|
25
|
-
abstract gen(ctx?: Context): any;
|
|
26
|
-
}
|
|
27
|
-
declare class Nil extends Val {
|
|
28
|
-
nil: boolean;
|
|
29
|
-
why: any;
|
|
30
|
-
primary?: Val;
|
|
31
|
-
secondary?: Val;
|
|
32
|
-
static make: (ctx?: Context, why?: any, av?: Val, bv?: Val) => Nil;
|
|
33
|
-
constructor(why?: any, ctx?: Context);
|
|
34
|
-
unify(_peer: Val, _ctx: Context): this;
|
|
35
|
-
get canon(): string;
|
|
36
|
-
gen(_ctx?: Context): undefined;
|
|
37
|
-
}
|
|
3
|
+
import { ValBase } from './val/ValBase';
|
|
38
4
|
declare class Integer {
|
|
39
5
|
}
|
|
40
6
|
declare type ScalarConstructor = StringConstructor | NumberConstructor | BooleanConstructor | (typeof Integer.constructor);
|
|
41
|
-
declare class ScalarTypeVal extends
|
|
7
|
+
declare class ScalarTypeVal extends ValBase {
|
|
42
8
|
constructor(peg: ScalarConstructor, ctx?: Context);
|
|
43
9
|
unify(peer: Val, ctx: Context): Val;
|
|
44
10
|
get canon(): any;
|
|
45
11
|
same(peer: Val): boolean;
|
|
46
12
|
gen(_ctx?: Context): undefined;
|
|
47
13
|
}
|
|
48
|
-
declare class ScalarVal<T> extends
|
|
14
|
+
declare class ScalarVal<T> extends ValBase {
|
|
49
15
|
type: any;
|
|
50
16
|
constructor(peg: T, type: ScalarConstructor, ctx?: Context);
|
|
51
17
|
unify(peer: Val, ctx: Context): Val;
|
|
@@ -72,55 +38,4 @@ declare class BooleanVal extends ScalarVal<boolean> {
|
|
|
72
38
|
static TRUE: BooleanVal;
|
|
73
39
|
static FALSE: BooleanVal;
|
|
74
40
|
}
|
|
75
|
-
|
|
76
|
-
static SPREAD: symbol;
|
|
77
|
-
spread: {
|
|
78
|
-
cj: Val | undefined;
|
|
79
|
-
};
|
|
80
|
-
constructor(peg: ValMap, ctx?: Context);
|
|
81
|
-
unify(peer: Val, ctx: Context): Val;
|
|
82
|
-
get canon(): string;
|
|
83
|
-
gen(ctx?: Context): any;
|
|
84
|
-
}
|
|
85
|
-
declare class ListVal extends Val {
|
|
86
|
-
static SPREAD: symbol;
|
|
87
|
-
spread: {
|
|
88
|
-
cj: Val | undefined;
|
|
89
|
-
};
|
|
90
|
-
constructor(peg: ValList, ctx?: Context);
|
|
91
|
-
unify(peer: Val, ctx: Context): Val;
|
|
92
|
-
get canon(): string;
|
|
93
|
-
gen(ctx?: Context): any;
|
|
94
|
-
}
|
|
95
|
-
declare class ConjunctVal extends Val {
|
|
96
|
-
constructor(peg: Val[], ctx?: Context);
|
|
97
|
-
append(peer: Val): ConjunctVal;
|
|
98
|
-
unify(peer: Val, ctx: Context): Val;
|
|
99
|
-
get canon(): any;
|
|
100
|
-
gen(ctx?: Context): any;
|
|
101
|
-
}
|
|
102
|
-
declare class DisjunctVal extends Val {
|
|
103
|
-
constructor(peg: Val[], ctx?: Context, _sites?: Site[]);
|
|
104
|
-
append(peer: Val): DisjunctVal;
|
|
105
|
-
unify(peer: Val, ctx: Context): Val;
|
|
106
|
-
get canon(): any;
|
|
107
|
-
gen(ctx?: Context): any;
|
|
108
|
-
}
|
|
109
|
-
declare class RefVal extends Val {
|
|
110
|
-
parts: string[];
|
|
111
|
-
absolute: boolean;
|
|
112
|
-
sep: string;
|
|
113
|
-
constructor(peg: any[], abs?: boolean);
|
|
114
|
-
append(part: any): void;
|
|
115
|
-
unify(peer: Val, ctx: Context): Val;
|
|
116
|
-
get canon(): any;
|
|
117
|
-
gen(_ctx?: Context): undefined;
|
|
118
|
-
}
|
|
119
|
-
declare class PrefVal extends Val {
|
|
120
|
-
pref: Val;
|
|
121
|
-
constructor(peg: any, pref?: any, ctx?: Context);
|
|
122
|
-
unify(peer: Val, ctx: Context): Val;
|
|
123
|
-
get canon(): any;
|
|
124
|
-
gen(ctx?: Context): any;
|
|
125
|
-
}
|
|
126
|
-
export { DONE, Integer, Val, TOP, Nil, ScalarTypeVal, NumberVal, StringVal, BooleanVal, IntegerVal, MapVal, ListVal, ConjunctVal, DisjunctVal, RefVal, PrefVal, };
|
|
41
|
+
export { Integer, ScalarTypeVal, NumberVal, StringVal, BooleanVal, IntegerVal, };
|