aontu 0.61.0 → 0.63.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/README.md +4 -4
- package/dist/agentsmd.d.ts +1 -0
- package/dist/agentsmd.js +7 -28
- package/dist/agentsmd.js.map +1 -1
- package/dist/alias.js.map +1 -1
- package/dist/allow.d.ts +23 -0
- package/dist/allow.js +138 -0
- package/dist/allow.js.map +1 -0
- package/dist/aontu.d.ts +4 -2
- package/dist/aontu.js +4 -80
- package/dist/aontu.js.map +1 -1
- package/dist/aontumodel.d.ts +4 -0
- package/dist/aontumodel.js +33 -0
- package/dist/aontumodel.js.map +1 -0
- package/dist/cli.d.ts +10 -1
- package/dist/cli.js +877 -479
- package/dist/cli.js.map +1 -1
- package/dist/ctx.js +0 -48
- package/dist/ctx.js.map +1 -1
- package/dist/diff.js +0 -32
- package/dist/diff.js.map +1 -1
- package/dist/err.js +0 -40
- package/dist/err.js.map +1 -1
- package/dist/escape.js +0 -45
- package/dist/escape.js.map +1 -1
- package/dist/exactjson.d.ts +0 -35
- package/dist/exactjson.js +0 -131
- package/dist/exactjson.js.map +1 -1
- package/dist/format.js +55 -189
- package/dist/format.js.map +1 -1
- package/dist/grammar.d.ts +9 -0
- package/dist/grammar.js +54 -0
- package/dist/grammar.js.map +1 -0
- package/dist/graph.js +0 -26
- package/dist/graph.js.map +1 -1
- package/dist/hcanon.js +0 -82
- package/dist/hcanon.js.map +1 -1
- package/dist/helpdoc.d.ts +16 -0
- package/dist/helpdoc.js +59 -0
- package/dist/helpdoc.js.map +1 -0
- package/dist/hints.d.ts +0 -6
- package/dist/hints.js +59 -47
- package/dist/hints.js.map +1 -1
- package/dist/jsonschema.js +0 -114
- package/dist/jsonschema.js.map +1 -1
- package/dist/keyorder.d.ts +0 -7
- package/dist/keyorder.js +0 -41
- package/dist/keyorder.js.map +1 -1
- package/dist/lang.js +32 -877
- package/dist/lang.js.map +1 -1
- package/dist/lower.d.ts +3 -0
- package/dist/lower.js +14 -61
- package/dist/lower.js.map +1 -1
- package/dist/lsp-server.js +0 -16
- package/dist/lsp-server.js.map +1 -1
- package/dist/lsp.d.ts +1 -1
- package/dist/lsp.js +12 -159
- package/dist/lsp.js.map +1 -1
- package/dist/mcp-server.js +0 -26
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp.js +0 -113
- package/dist/mcp.js.map +1 -1
- package/dist/mod-tool.js +0 -130
- package/dist/mod-tool.js.map +1 -1
- package/dist/mod.js +0 -162
- package/dist/mod.js.map +1 -1
- package/dist/patch.js +0 -217
- package/dist/patch.js.map +1 -1
- package/dist/provenance.js +0 -140
- package/dist/provenance.js.map +1 -1
- package/dist/query.js +0 -75
- package/dist/query.js.map +1 -1
- package/dist/reach.js +0 -43
- package/dist/reach.js.map +1 -1
- package/dist/relation.d.ts +2 -0
- package/dist/relation.js +3 -58
- package/dist/relation.js.map +1 -1
- package/dist/render.js +33 -143
- package/dist/render.js.map +1 -1
- package/dist/report-sarif.d.ts +0 -11
- package/dist/report-sarif.js +0 -28
- package/dist/report-sarif.js.map +1 -1
- package/dist/sig.js +0 -35
- package/dist/sig.js.map +1 -1
- package/dist/sigdecl.js +1 -1
- package/dist/sigdecl.js.map +1 -1
- package/dist/siggate.js +0 -4
- package/dist/siggate.js.map +1 -1
- package/dist/site.js +3 -29
- package/dist/site.js.map +1 -1
- package/dist/subsume.d.ts +0 -10
- package/dist/subsume.js +0 -137
- package/dist/subsume.js.map +1 -1
- package/dist/template.d.ts +2 -1
- package/dist/template.js +58 -138
- package/dist/template.js.map +1 -1
- package/dist/trim.js +0 -41
- package/dist/trim.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type.js.map +1 -1
- package/dist/unify.js +12 -242
- package/dist/unify.js.map +1 -1
- package/dist/utility.js +0 -22
- package/dist/utility.js.map +1 -1
- package/dist/val/AbnfFuncVal.d.ts +18 -0
- package/dist/val/AbnfFuncVal.js +132 -0
- package/dist/val/AbnfFuncVal.js.map +1 -0
- package/dist/val/AbsentVal.d.ts +11 -0
- package/dist/val/AbsentVal.js +30 -0
- package/dist/val/AbsentVal.js.map +1 -0
- package/dist/val/AggFuncVal.d.ts +10 -1
- package/dist/val/AggFuncVal.js +104 -116
- package/dist/val/AggFuncVal.js.map +1 -1
- package/dist/val/ArithFuncVal.js +0 -12
- package/dist/val/ArithFuncVal.js.map +1 -1
- package/dist/val/BagVal.js +1 -78
- package/dist/val/BagVal.js.map +1 -1
- package/dist/val/BigDecimalVal.js +0 -16
- package/dist/val/BigDecimalVal.js.map +1 -1
- package/dist/val/BigIntegerVal.js +0 -16
- package/dist/val/BigIntegerVal.js.map +1 -1
- package/dist/val/CloseFuncVal.js +0 -9
- package/dist/val/CloseFuncVal.js.map +1 -1
- package/dist/val/CmpFuncVal.d.ts +20 -0
- package/dist/val/CmpFuncVal.js +188 -0
- package/dist/val/CmpFuncVal.js.map +1 -0
- package/dist/val/ConjunctVal.js +0 -29
- package/dist/val/ConjunctVal.js.map +1 -1
- package/dist/val/ConstraintVal.js +0 -500
- package/dist/val/ConstraintVal.js.map +1 -1
- package/dist/val/ContainerKindVal.js +0 -2
- package/dist/val/ContainerKindVal.js.map +1 -1
- package/dist/val/CopyFuncVal.js +0 -3
- package/dist/val/CopyFuncVal.js.map +1 -1
- package/dist/val/Decimal.js +0 -179
- package/dist/val/Decimal.js.map +1 -1
- package/dist/val/DeprecateFuncVal.js.map +1 -1
- package/dist/val/DisjunctVal.js +0 -152
- package/dist/val/DisjunctVal.js.map +1 -1
- package/dist/val/EachFuncVal.d.ts +1 -2
- package/dist/val/EachFuncVal.js +12 -29
- package/dist/val/EachFuncVal.js.map +1 -1
- package/dist/val/EmitFuncVal.d.ts +1 -1
- package/dist/val/EmitFuncVal.js +6 -119
- package/dist/val/EmitFuncVal.js.map +1 -1
- package/dist/val/ExpectVal.js +0 -62
- package/dist/val/ExpectVal.js.map +1 -1
- package/dist/val/FilterFuncVal.js +0 -25
- package/dist/val/FilterFuncVal.js.map +1 -1
- package/dist/val/FuncBaseVal.d.ts +1 -0
- package/dist/val/FuncBaseVal.js +7 -127
- package/dist/val/FuncBaseVal.js.map +1 -1
- package/dist/val/GraphAtomVal.js +0 -15
- package/dist/val/GraphAtomVal.js.map +1 -1
- package/dist/val/HideFuncVal.js +0 -13
- package/dist/val/HideFuncVal.js.map +1 -1
- package/dist/val/IntegerVal.js +0 -61
- package/dist/val/IntegerVal.js.map +1 -1
- package/dist/val/JunctionVal.js +0 -20
- package/dist/val/JunctionVal.js.map +1 -1
- package/dist/val/KeyFuncVal.js +0 -46
- package/dist/val/KeyFuncVal.js.map +1 -1
- package/dist/val/ListVal.js +0 -57
- package/dist/val/ListVal.js.map +1 -1
- package/dist/val/LowerFuncVal.js +11 -6
- package/dist/val/LowerFuncVal.js.map +1 -1
- package/dist/val/MapVal.js +0 -151
- package/dist/val/MapVal.js.map +1 -1
- package/dist/val/MatchFuncVal.js +0 -27
- package/dist/val/MatchFuncVal.js.map +1 -1
- package/dist/val/{FormFuncVal.d.ts → MaybeFuncVal.d.ts} +5 -5
- package/dist/val/MaybeFuncVal.js +50 -0
- package/dist/val/MaybeFuncVal.js.map +1 -0
- package/dist/val/MoveFuncVal.js +0 -18
- package/dist/val/MoveFuncVal.js.map +1 -1
- package/dist/val/NilVal.js +2 -36
- package/dist/val/NilVal.js.map +1 -1
- package/dist/val/NomFuncVal.d.ts +12 -0
- package/dist/val/NomFuncVal.js +153 -0
- package/dist/val/NomFuncVal.js.map +1 -0
- package/dist/val/NumberVal.js +0 -15
- package/dist/val/NumberVal.js.map +1 -1
- package/dist/val/OpBaseVal.d.ts +1 -0
- package/dist/val/OpBaseVal.js +3 -15
- package/dist/val/OpBaseVal.js.map +1 -1
- package/dist/val/PackFuncVal.js +0 -34
- package/dist/val/PackFuncVal.js.map +1 -1
- package/dist/val/PathFuncVal.js +0 -6
- package/dist/val/PathFuncVal.js.map +1 -1
- package/dist/val/PathVal.js +0 -41
- package/dist/val/PathVal.js.map +1 -1
- package/dist/val/PlaceVal.js +0 -25
- package/dist/val/PlaceVal.js.map +1 -1
- package/dist/val/PlusOpVal.d.ts +1 -7
- package/dist/val/PlusOpVal.js +13 -74
- package/dist/val/PlusOpVal.js.map +1 -1
- package/dist/val/PrefFuncVal.js +0 -1
- package/dist/val/PrefFuncVal.js.map +1 -1
- package/dist/val/PrefVal.js +0 -167
- package/dist/val/PrefVal.js.map +1 -1
- package/dist/val/RecurseVal.js +0 -55
- package/dist/val/RecurseVal.js.map +1 -1
- package/dist/val/RefVal.js +0 -282
- package/dist/val/RefVal.js.map +1 -1
- package/dist/val/ReferFuncVal.js +0 -232
- package/dist/val/ReferFuncVal.js.map +1 -1
- package/dist/val/ScalarKindVal.js +0 -49
- package/dist/val/ScalarKindVal.js.map +1 -1
- package/dist/val/ScalarVal.js +0 -11
- package/dist/val/ScalarVal.js.map +1 -1
- package/dist/val/StrFuncVal.js +0 -18
- package/dist/val/StrFuncVal.js.map +1 -1
- package/dist/val/SuperFuncVal.js +0 -32
- package/dist/val/SuperFuncVal.js.map +1 -1
- package/dist/val/TopVal.js +0 -1
- package/dist/val/TopVal.js.map +1 -1
- package/dist/val/TranslateFuncVal.d.ts +12 -0
- package/dist/val/TranslateFuncVal.js +99 -0
- package/dist/val/TranslateFuncVal.js.map +1 -0
- package/dist/val/UpperFuncVal.js +11 -6
- package/dist/val/UpperFuncVal.js.map +1 -1
- package/dist/val/Val.d.ts +1 -0
- package/dist/val/Val.js +2 -133
- package/dist/val/Val.js.map +1 -1
- package/dist/val/VarVal.js +0 -12
- package/dist/val/VarVal.js.map +1 -1
- package/dist/val/arith.js +0 -37
- package/dist/val/arith.js.map +1 -1
- package/dist/val/caserange.d.ts +3 -0
- package/dist/val/caserange.js +49 -0
- package/dist/val/caserange.js.map +1 -0
- package/dist/val/members.js +0 -6
- package/dist/val/members.js.map +1 -1
- package/dist/val/numcmp.js +0 -11
- package/dist/val/numcmp.js.map +1 -1
- package/dist/val/numkind.js +0 -145
- package/dist/val/numkind.js.map +1 -1
- package/dist/val/valutil.js +0 -16
- package/dist/val/valutil.js.map +1 -1
- package/dist/vet.d.ts +12 -0
- package/dist/vet.js +159 -412
- package/dist/vet.js.map +1 -1
- package/dist/view.js +0 -414
- package/dist/view.js.map +1 -1
- package/dist/walk.js +0 -41
- package/dist/walk.js.map +1 -1
- package/grammar/aontu.abnf +9 -7
- package/grammar/aontu.gbnf +5 -5
- package/grammar/aontu.lark +5 -5
- package/grammar/aontu.tmLanguage.json +1 -1
- package/package.json +4 -2
- package/skill/SKILL.md +8 -0
- package/skill/init/check.sh +28 -0
- package/skill/init/data.aon +12 -0
- package/skill/init/model.aon +19 -0
- package/skill/tasks.md +151 -0
- package/src/agentsmd.ts +8 -32
- package/src/alias.ts +0 -39
- package/src/allow.ts +221 -0
- package/src/aontu.ts +10 -108
- package/src/aontumodel.ts +32 -0
- package/src/cli.ts +1009 -540
- package/src/ctx.ts +0 -103
- package/src/diff.ts +0 -40
- package/src/err.ts +0 -40
- package/src/escape.ts +0 -46
- package/src/exactjson.ts +0 -131
- package/src/format.ts +63 -234
- package/src/grammar.ts +72 -0
- package/src/graph.ts +0 -61
- package/src/hcanon.ts +0 -82
- package/src/helpdoc.ts +77 -0
- package/src/hints.ts +72 -49
- package/src/jsonschema.ts +0 -123
- package/src/keyorder.ts +0 -42
- package/src/lang.ts +39 -895
- package/src/lower.ts +15 -65
- package/src/lsp-server.ts +0 -16
- package/src/lsp.ts +12 -180
- package/src/mcp-server.ts +0 -31
- package/src/mcp.ts +0 -130
- package/src/mod-tool.ts +0 -158
- package/src/mod.ts +0 -178
- package/src/patch.ts +0 -232
- package/src/provenance.ts +0 -183
- package/src/query.ts +0 -84
- package/src/reach.ts +0 -53
- package/src/relation.ts +7 -71
- package/src/render.ts +33 -180
- package/src/report-sarif.ts +0 -48
- package/src/sig.ts +0 -35
- package/src/sigdecl.ts +1 -1
- package/src/siggate.ts +0 -30
- package/src/site.ts +3 -29
- package/src/subsume.ts +1 -161
- package/src/template.ts +69 -140
- package/src/trim.ts +0 -53
- package/src/type.ts +2 -45
- package/src/unify.ts +13 -251
- package/src/utility.ts +0 -31
- package/src/val/AbnfFuncVal.ts +181 -0
- package/src/val/AbsentVal.ts +54 -0
- package/src/val/AggFuncVal.ts +152 -188
- package/src/val/ArithFuncVal.ts +0 -20
- package/src/val/BagVal.ts +1 -78
- package/src/val/BigDecimalVal.ts +0 -16
- package/src/val/BigIntegerVal.ts +0 -16
- package/src/val/CloseFuncVal.ts +0 -9
- package/src/val/CmpFuncVal.ts +249 -0
- package/src/val/ConjunctVal.ts +0 -33
- package/src/val/ConstraintVal.ts +2 -537
- package/src/val/ContainerKindVal.ts +0 -18
- package/src/val/CopyFuncVal.ts +0 -5
- package/src/val/Decimal.ts +1 -185
- package/src/val/DeprecateFuncVal.ts +0 -10
- package/src/val/DisjunctVal.ts +0 -157
- package/src/val/EachFuncVal.ts +12 -53
- package/src/val/EmitFuncVal.ts +8 -208
- package/src/val/ExpectVal.ts +0 -62
- package/src/val/FilterFuncVal.ts +0 -55
- package/src/val/FuncBaseVal.ts +9 -130
- package/src/val/GraphAtomVal.ts +0 -42
- package/src/val/HideFuncVal.ts +0 -15
- package/src/val/IntegerVal.ts +0 -61
- package/src/val/JunctionVal.ts +0 -20
- package/src/val/KeyFuncVal.ts +0 -48
- package/src/val/ListVal.ts +0 -59
- package/src/val/LowerFuncVal.ts +12 -7
- package/src/val/MapVal.ts +0 -151
- package/src/val/MatchFuncVal.ts +0 -59
- package/src/val/MaybeFuncVal.ts +86 -0
- package/src/val/MoveFuncVal.ts +0 -20
- package/src/val/NilVal.ts +2 -36
- package/src/val/NomFuncVal.ts +200 -0
- package/src/val/NumberVal.ts +0 -16
- package/src/val/OpBaseVal.ts +4 -17
- package/src/val/PackFuncVal.ts +0 -63
- package/src/val/PathFuncVal.ts +0 -32
- package/src/val/PathVal.ts +0 -66
- package/src/val/PlaceVal.ts +0 -45
- package/src/val/PlusOpVal.ts +18 -75
- package/src/val/PrefFuncVal.ts +0 -1
- package/src/val/PrefVal.ts +0 -179
- package/src/val/RecurseVal.ts +0 -81
- package/src/val/RefVal.ts +1 -285
- package/src/val/ReferFuncVal.ts +0 -255
- package/src/val/ScalarKindVal.ts +0 -50
- package/src/val/ScalarVal.ts +0 -12
- package/src/val/StrFuncVal.ts +0 -44
- package/src/val/SuperFuncVal.ts +0 -42
- package/src/val/TopVal.ts +0 -1
- package/src/val/TranslateFuncVal.ts +132 -0
- package/src/val/UpperFuncVal.ts +12 -7
- package/src/val/Val.ts +3 -192
- package/src/val/VarVal.ts +0 -15
- package/src/val/arith.ts +0 -92
- package/src/val/caserange.ts +53 -0
- package/src/val/members.ts +0 -23
- package/src/val/numcmp.ts +1 -27
- package/src/val/numkind.ts +0 -149
- package/src/val/valutil.ts +0 -16
- package/src/vet.ts +209 -504
- package/src/view.ts +0 -507
- package/src/walk.ts +0 -41
- package/dist/std.d.ts +0 -3
- package/dist/std.js +0 -637
- package/dist/std.js.map +0 -1
- package/dist/val/FormFuncVal.js +0 -55
- package/dist/val/FormFuncVal.js.map +0 -1
- package/src/std.ts +0 -648
- package/src/val/FormFuncVal.ts +0 -119
package/src/walk.ts
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
2
2
|
|
|
3
|
-
// One tree walk, two consumers: the language server collects NilVals
|
|
4
|
-
// for diagnostics (ts/src/lsp.ts) and the validation verb both stamps
|
|
5
|
-
// provenance and collects NilVals for findings (ts/src/vet.ts). They had
|
|
6
|
-
// the same traversal written out twice, which is one copy too many for
|
|
7
|
-
// something with three easy ways to be subtly wrong:
|
|
8
|
-
//
|
|
9
|
-
// - a Val's children live under `peg`, which is an ARRAY for lists,
|
|
10
|
-
// conjuncts and disjuncts, and an OBJECT for maps;
|
|
11
|
-
// - a spread constraint lives OFF-peg (`spread.cj`), so a value inside
|
|
12
|
-
// a `&:` template is reachable only by following it deliberately;
|
|
13
|
-
// - the `seen` set is a termination guard, not an optimisation, and
|
|
14
|
-
// the non-Val guard is load-bearing too: a peg object can hold
|
|
15
|
-
// entries that are not Vals.
|
|
16
|
-
//
|
|
17
|
-
// The visitor returns false to prune the subtree below a node, which is
|
|
18
|
-
// how a nil collector stops at the nil rather than walking into the
|
|
19
|
-
// operands it carries.
|
|
20
3
|
|
|
21
4
|
export function walkVals(
|
|
22
5
|
v: any,
|
|
@@ -52,40 +35,16 @@ export function walkVals(
|
|
|
52
35
|
walkVals(spread, visit, seen)
|
|
53
36
|
}
|
|
54
37
|
|
|
55
|
-
// OFF-PEG VALUES THAT CAN BE REPORTED. A preference carries the type
|
|
56
|
-
// yardstick it derived from its own value, and a `must` carries the
|
|
57
|
-
// value it checks against; neither is a peg entry, and both can end
|
|
58
|
-
// up as an operand of a failure — the preference's yardstick is what
|
|
59
|
-
// `*1 & {}` conflicts with. A caller
|
|
60
|
-
// that stamps provenance (ts/src/vet.ts) has to reach them, or a
|
|
61
|
-
// report names the document such a value came from as "unknown",
|
|
62
|
-
// and the two ports disagree about it (go/walk.go does the same).
|
|
63
38
|
walkVals(v.superpeg, visit, seen)
|
|
64
39
|
for (const must of (v.musts ?? [])) {
|
|
65
40
|
walkVals(must?.v, visit, seen)
|
|
66
41
|
}
|
|
67
42
|
|
|
68
|
-
// A FAILURE'S OPERANDS, for the same reason and with the same
|
|
69
|
-
// safety. They are not peg entries, and they are exactly what a
|
|
70
|
-
// report names: a finding's sites are the nil's primary and
|
|
71
|
-
// secondary (ts/src/vet.ts, siteOf). A visitor that PRUNES at a nil
|
|
72
|
-
// never gets here -- collectNils returns false and this line is
|
|
73
|
-
// behind that gate -- so a nil collector is unaffected. A visitor
|
|
74
|
-
// that does not prune, and stamping provenance is the one that does
|
|
75
|
-
// not, must reach them or a broken schema's finding names no file at
|
|
76
|
-
// all (go/walk.go does the same).
|
|
77
43
|
walkVals(v.primary, visit, seen)
|
|
78
44
|
walkVals(v.secondary, visit, seen)
|
|
79
45
|
}
|
|
80
46
|
|
|
81
47
|
|
|
82
|
-
// Every NilVal in the tree, in walk order. Callers that need a stable
|
|
83
|
-
// order across the two ports must sort — the walk follows raw key
|
|
84
|
-
// order, and the hosts disagree about that (ts/src/keyorder.ts).
|
|
85
|
-
//
|
|
86
|
-
// The `seen` set is the caller's, not an internal detail: both callers
|
|
87
|
-
// go on to dedup context-only errors against the nils already found,
|
|
88
|
-
// which is only possible if they hold the set.
|
|
89
48
|
export function collectNils(root: any, seen: Set<any>): any[] {
|
|
90
49
|
const out: any[] = []
|
|
91
50
|
walkVals(root, (v: any) => {
|
package/dist/std.d.ts
DELETED
package/dist/std.js
DELETED
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AONTU_MODELS = exports.AONTU_SCHEME = exports.STD_SOURCES = void 0;
|
|
5
|
-
// THE BUNDLED VOCABULARY (G4 phase 4,
|
|
6
|
-
// docs/capability-review/g4-identity-relations.md): `@"std/system"` is
|
|
7
|
-
// served from the engine itself — no filesystem, no package resolution
|
|
8
|
-
// — so a document may use it under every include capability except
|
|
9
|
-
// `none`, and the hermeticity posture is not widened by a source that
|
|
10
|
-
// never leaves the process.
|
|
11
|
-
//
|
|
12
|
-
// The TEXT is the shared artifact: go/std.go carries the same bytes,
|
|
13
|
-
// and test/spec/std-system.tsv pins its canon and its canon-hash in
|
|
14
|
-
// both engines, so the two copies cannot drift without a red suite.
|
|
15
|
-
// It carries no backtick for that reason: one string literal per port,
|
|
16
|
-
// and Go's raw string has no escape.
|
|
17
|
-
const STD_SYSTEM = `# std/system --- the SYSTEM VOCABULARY (G4 phase 4). Ports, components
|
|
18
|
-
# and relations need no syntax: they are schemas. Everything here is
|
|
19
|
-
# ordinary unification --- conjunction, spreads, marks, defaults ---
|
|
20
|
-
# so the vocabulary costs the language nothing, and an author who wants
|
|
21
|
-
# a different one writes it the same way.
|
|
22
|
-
#
|
|
23
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
24
|
-
# canon-hash. Entity ids deliberately do NOT embed versions: fusing
|
|
25
|
-
# identity and version makes "v1 and v2 describe the same entity"
|
|
26
|
-
# inexpressible.
|
|
27
|
-
|
|
28
|
-
std: {
|
|
29
|
-
|
|
30
|
-
# One end of a connection.
|
|
31
|
-
Port: type({
|
|
32
|
-
direction: *in | out | inout
|
|
33
|
-
protocol?: string
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
# A node with ports. Where a Component sits in the tree is what it
|
|
37
|
-
# is a component OF -- containment is the document's own structure
|
|
38
|
-
# and needs no mark of its own.
|
|
39
|
-
Component: type({
|
|
40
|
-
ports?: {&: $.std.Port}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
# A component that is a service. Written out rather than as
|
|
44
|
-
# $.std.Component & {kind: service}: a reference from one member of
|
|
45
|
-
# this file to another does not survive being INCLUDED into a
|
|
46
|
-
# document (the marks the include carries make the referring member
|
|
47
|
-
# unusable), so the vocabulary states each schema on its own.
|
|
48
|
-
Service: type({
|
|
49
|
-
kind: service
|
|
50
|
-
ports?: {&: $.std.Port}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
# (The Relation schema that used to sit here is retired with the
|
|
54
|
-
# relations: magic key, RELATIONS.0.md P2: a relation is declared
|
|
55
|
-
# by the graph atoms at its field -- rel(t) & acyclic() &
|
|
56
|
-
# inverse(name) -- and the target half is rel(t)'s flow.)
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const STD_VIEW = `# std/view --- the FIGURE VOCABULARY (VIEWS.0.md, "6. The view
|
|
60
|
-
# document"). A view document declares its figures as data, and a
|
|
61
|
-
# declaration is just a map: this is the schema for one, so a typo is
|
|
62
|
-
# refused where every other mistake in an aontu document is refused --
|
|
63
|
-
# at evaluation, by unification -- rather than by the verb that reads
|
|
64
|
-
# it afterwards.
|
|
65
|
-
#
|
|
66
|
-
# @"std/view"
|
|
67
|
-
# @"./system.aon"
|
|
68
|
-
#
|
|
69
|
-
# views: {&: $.view.Figure} & {
|
|
70
|
-
# arch: {kind: matrix, order: partition, out: "docs/arch.dsm.txt"}
|
|
71
|
-
# }
|
|
72
|
-
#
|
|
73
|
-
# The keys ARE the view options: the command-line flags without the
|
|
74
|
-
# dashes, one vocabulary for the CLI, the library and the file. The
|
|
75
|
-
# poset is not among the kinds, because a view document declares
|
|
76
|
-
# figures of the ONE document it includes and the poset compares
|
|
77
|
-
# several.
|
|
78
|
-
#
|
|
79
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
80
|
-
# canon-hash. This file carries no backtick: it is one string literal
|
|
81
|
-
# per port, and Go raw strings have no escape.
|
|
82
|
-
|
|
83
|
-
view: {
|
|
84
|
-
|
|
85
|
-
# One declared figure. The kind says what to draw and out says where
|
|
86
|
-
# it belongs; everything else narrows the drawing, and each option
|
|
87
|
-
# belongs to the kinds that read it.
|
|
88
|
-
Figure: type({
|
|
89
|
-
kind: doc | lattice | tree | matrix | graph | layer | sets | layers
|
|
90
|
-
| ladder
|
|
91
|
-
out: string
|
|
92
|
-
|
|
93
|
-
# Every kind.
|
|
94
|
-
as?: text | mermaid | dot | er | svg
|
|
95
|
-
at?: string
|
|
96
|
-
maxRows?: integer & min(0)
|
|
97
|
-
|
|
98
|
-
# doc: how many levels of key to draw.
|
|
99
|
-
depth?: integer & min(0)
|
|
100
|
-
|
|
101
|
-
# tree, matrix, layer: the relation drawn. graph: the predicates
|
|
102
|
-
# kept. tree: the subtrees drawn.
|
|
103
|
-
relation?: string
|
|
104
|
-
relations?: [&: string]
|
|
105
|
-
roots?: [&: string]
|
|
106
|
-
|
|
107
|
-
# matrix.
|
|
108
|
-
order?: canon | partition
|
|
109
|
-
closure?: boolean
|
|
110
|
-
|
|
111
|
-
# graph, layer.
|
|
112
|
-
groupBy?: string
|
|
113
|
-
label?: string
|
|
114
|
-
layers?: [&: string]
|
|
115
|
-
edges?: upward | all | none
|
|
116
|
-
|
|
117
|
-
# sets, layers.
|
|
118
|
-
sets?: string
|
|
119
|
-
member?: string
|
|
120
|
-
universe?: string
|
|
121
|
-
minDegree?: integer & min(0)
|
|
122
|
-
maxCols?: integer & min(0)
|
|
123
|
-
minSize?: integer & min(0)
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
// THE LANGUAGE-SUPPLIED MODELS (docs/design/MODELS.0.md D1;
|
|
128
|
-
// docs/design/RENDER.0.md P0 and P1). `aontu:NAME` is Node's device --
|
|
129
|
-
// a prefix no relative path, package name or module path can spell --
|
|
130
|
-
// so the resolver routes on it before any other leg and never touches
|
|
131
|
-
// the filesystem for it. Held in String.raw so the backslashes of the
|
|
132
|
-
// regexes reach the parser as written; no backtick, as above.
|
|
133
|
-
//
|
|
134
|
-
// aontu:code is the OUTPUT VOCABULARY: an instance of it is what a
|
|
135
|
-
// transform evaluates to and what `aontu render` folds to bytes.
|
|
136
|
-
// aontu:profile is the schema of a render profile, the data a unit of
|
|
137
|
-
// one language is rendered under. Both are pinned by canon and hash
|
|
138
|
-
// rows (test/spec/aontu-code.tsv, test/spec/aontu-profile.tsv).
|
|
139
|
-
const STD_CODE = String.raw `# aontu:code --- THE OUTPUT VOCABULARY. An aontu transform evaluates to
|
|
140
|
-
# an instance of this schema, and 'aontu render' turns the instance
|
|
141
|
-
# into bytes. Because it is an ordinary schema, a transform's result is
|
|
142
|
-
# checked by unification before anything is rendered.
|
|
143
|
-
#
|
|
144
|
-
# @"aontu:code"
|
|
145
|
-
# code: { units: [ { path: "out.py", lang: "python", decls: [
|
|
146
|
-
# { k: "frag", of: emit($.model, %rules) } ] } ] }
|
|
147
|
-
#
|
|
148
|
-
# TWO ESCAPES, both counted by the render report: {k: "text", lang,
|
|
149
|
-
# text} carries verbatim target syntax, and 'x' is an open per-backend
|
|
150
|
-
# rider. CONTAINER TYPES TAKE LEAVES ONLY: anything deeper is a named
|
|
151
|
-
# alias declaration plus a {k: "ref"}, which keeps this schema's meet
|
|
152
|
-
# linear. A FRAGMENT IS FLAT: each piece carries its own depth ('at'),
|
|
153
|
-
# so the renderer owns every prefix and no piece nests another; a bare
|
|
154
|
-
# string piece is a line at depth 0, and no inline text may hold a line
|
|
155
|
-
# terminator -- that is checked here, before any renderer runs.
|
|
156
|
-
#
|
|
157
|
-
# THE ROOT IS NOT type()-MARKED, on purpose: 'aontu render' reads the
|
|
158
|
-
# instance through generate(), and a type()-marked subtree does not
|
|
159
|
-
# generate. A document that includes this vocabulary and writes no
|
|
160
|
-
# units generates 'code: {units: []}', which is what it said.
|
|
161
|
-
#
|
|
162
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
163
|
-
# canon-hash.
|
|
164
|
-
|
|
165
|
-
%name = string & re("^[A-Za-z_][A-Za-z0-9_]*$") & length(min(1) & max(255))
|
|
166
|
-
|
|
167
|
-
%text = close({ k:"text" lang:string & length(min(1)) text:string })
|
|
168
|
-
|
|
169
|
-
%doc = close({
|
|
170
|
-
text: string
|
|
171
|
-
deprecated?: close({ msg?:string use?:string since?:string })
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
%check = close({ c:"min" n:number exclusive:*false | boolean })
|
|
175
|
-
| close({ c:"max" n:number exclusive:*false | boolean })
|
|
176
|
-
| close({ c:"re" p:string })
|
|
177
|
-
| close({ c:"len" min?:integer & min(0) max?:integer & min(0) })
|
|
178
|
-
| close({ c:"unique" key?:%name })
|
|
179
|
-
| close({ c:"ne" of:[&: string | number | boolean] })
|
|
180
|
-
| close({ c:"must" note:string })
|
|
181
|
-
|
|
182
|
-
%prim = close({
|
|
183
|
-
k: "prim"
|
|
184
|
-
prim: "string" | "int" | "bigint" | "float" | "decimal" | "bool" | "null" | "any"
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
%ref = close({ k:"ref" name:%name unit?:string })
|
|
188
|
-
%leaf = %prim | %ref | %text
|
|
189
|
-
|
|
190
|
-
%type = %leaf
|
|
191
|
-
| close({ k:"list" of:%leaf })
|
|
192
|
-
| close({ k:"map" key:%leaf of:%leaf })
|
|
193
|
-
| close({ k:"opt" of:%leaf })
|
|
194
|
-
| close({ k:"union" of:[&: %leaf] })
|
|
195
|
-
| close({ k:"lit" of:[&: string | number | boolean | null] })
|
|
196
|
-
|
|
197
|
-
%field = close({
|
|
198
|
-
name: %name
|
|
199
|
-
type: %type
|
|
200
|
-
optional: *false | boolean
|
|
201
|
-
doc?: %doc
|
|
202
|
-
default?: string | number | boolean | null
|
|
203
|
-
check?: [&: %check]
|
|
204
|
-
rel?: close({ to:string name?:string })
|
|
205
|
-
x?: {}
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
%member = close({ name:%name value?:string | number doc?:%doc x?:{} })
|
|
209
|
-
|
|
210
|
-
%param = close({
|
|
211
|
-
name: %name
|
|
212
|
-
type: %type
|
|
213
|
-
default?: string | number | boolean | null
|
|
214
|
-
x?: {}
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
# THE FRAGMENT ALGEBRA. A line's inline pieces hold no terminator; a
|
|
218
|
-
# blank is its terminators alone; a raw is the one piece that may carry
|
|
219
|
-
# terminators, re-indented to its depth unless it says not to.
|
|
220
|
-
%inline = string & re("^[^\n\r]*$") | %ref
|
|
221
|
-
%line = close({ k:"line" at:*0 | integer & min(0) & max(64) of:[&: %inline] })
|
|
222
|
-
%blank = close({ k:"blank" n:*1 | integer & min(1) & max(16) })
|
|
223
|
-
|
|
224
|
-
%raw = close({
|
|
225
|
-
k: "raw"
|
|
226
|
-
at: *0 | integer & min(0) & max(64)
|
|
227
|
-
text: string
|
|
228
|
-
reindent: *true | boolean
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
%piece = %line | %blank | %raw | string & re("^[^\n\r]*$")
|
|
232
|
-
%frag = close({ k:"frag" of:[&: %piece] })
|
|
233
|
-
%body = %frag | close({ k:"abstract" })
|
|
234
|
-
|
|
235
|
-
%record = close({
|
|
236
|
-
k: "record"
|
|
237
|
-
name: %name
|
|
238
|
-
doc?: %doc
|
|
239
|
-
open: *false | boolean
|
|
240
|
-
fields: [&: %field]
|
|
241
|
-
entity?: string
|
|
242
|
-
check?: [&: %check]
|
|
243
|
-
x?: {}
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
%enum = close({ k:"enum" name:%name doc?:%doc members:[&: %member] x?:{} })
|
|
247
|
-
|
|
248
|
-
%alias = close({
|
|
249
|
-
k: "alias"
|
|
250
|
-
name: %name
|
|
251
|
-
doc?: %doc
|
|
252
|
-
type: %type
|
|
253
|
-
check?: [&: %check]
|
|
254
|
-
x?: {}
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
%const = close({
|
|
258
|
-
k: "const"
|
|
259
|
-
name: %name
|
|
260
|
-
doc?: %doc
|
|
261
|
-
type?: %type
|
|
262
|
-
value: string | number | boolean | null
|
|
263
|
-
x?: {}
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
%func = close({
|
|
267
|
-
k: "func"
|
|
268
|
-
name: %name
|
|
269
|
-
doc?: %doc
|
|
270
|
-
params: [&: %param]
|
|
271
|
-
returns?: %type
|
|
272
|
-
body: %body
|
|
273
|
-
x?: {}
|
|
274
|
-
})
|
|
275
|
-
|
|
276
|
-
%decl = %record | %enum | %alias | %const | %func | %text | %frag
|
|
277
|
-
|
|
278
|
-
%import = close({
|
|
279
|
-
from: string & length(min(1))
|
|
280
|
-
names?: [&: %name]
|
|
281
|
-
alias?: %name
|
|
282
|
-
x?: {}
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
%unit = close({
|
|
286
|
-
path: string & length(min(1))
|
|
287
|
-
lang: string & length(min(1))
|
|
288
|
-
pkg?: string
|
|
289
|
-
doc?: %doc
|
|
290
|
-
imports?: [&: %import]
|
|
291
|
-
decls: [&: %decl]
|
|
292
|
-
profile?: {}
|
|
293
|
-
x?: {}
|
|
294
|
-
})
|
|
295
|
-
|
|
296
|
-
%source = close({ path?:string hash?:string & re("^aon1-[A-Za-z0-9_-]+$") })
|
|
297
|
-
|
|
298
|
-
code: close({ source?:%source units:[&: %unit] })
|
|
299
|
-
`;
|
|
300
|
-
const STD_PROFILE = String.raw `# aontu:profile --- THE PROFILE VOCABULARY. A profile is the data
|
|
301
|
-
# 'aontu render' applies to a unit of one language, and it is DATA and
|
|
302
|
-
# only data: a field belongs here only if the renderer applies it
|
|
303
|
-
# without looking at the shape of any node. Anything else is a lowering
|
|
304
|
-
# and lives in the transform.
|
|
305
|
-
#
|
|
306
|
-
# @"aontu:profile"
|
|
307
|
-
# profile: { lang: "python", indent: { unit: " ", width: 4 } }
|
|
308
|
-
#
|
|
309
|
-
# Three profiles are bundled with the engine -- aontu:lang/typescript,
|
|
310
|
-
# aontu:lang/go and aontu:lang/text -- and a unit is matched to one by
|
|
311
|
-
# its 'lang'. A fragment-only unit needs nothing beyond 'indent'.
|
|
312
|
-
#
|
|
313
|
-
# THE ROOT IS NOT type()-MARKED, for the reason aontu:code's is not:
|
|
314
|
-
# 'aontu render' reads a profile through generate().
|
|
315
|
-
#
|
|
316
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
317
|
-
# canon-hash.
|
|
318
|
-
|
|
319
|
-
%name = string & re("^[A-Za-z_][A-Za-z0-9_]*$")
|
|
320
|
-
|
|
321
|
-
%case = "as-is" | "camel" | "pascal" | "snake" | "screaming" | "kebab"
|
|
322
|
-
|
|
323
|
-
%comment = close({ open?:string prefix?:string close?:string })
|
|
324
|
-
|
|
325
|
-
%form = close({
|
|
326
|
-
open: *"" | string
|
|
327
|
-
close: *"" | string
|
|
328
|
-
prec: *9 | integer & min(0) & max(9)
|
|
329
|
-
childPrec: *0 | integer & min(0) & max(9)
|
|
330
|
-
})
|
|
331
|
-
|
|
332
|
-
%profile = close({
|
|
333
|
-
lang: string & length(min(1))
|
|
334
|
-
lowering?: "typescript" | "go"
|
|
335
|
-
indent: close({
|
|
336
|
-
unit: *" " | string & length(min(1))
|
|
337
|
-
width: *2 | integer & min(0) & max(16)
|
|
338
|
-
})
|
|
339
|
-
comment?: close({ line?:%comment block?:%comment doc?:%comment })
|
|
340
|
-
str?: close({
|
|
341
|
-
quote: *"\"" | string & length(min(1) & max(1))
|
|
342
|
-
escape: { &: string }
|
|
343
|
-
})
|
|
344
|
-
ident?: close({
|
|
345
|
-
chars: *"ascii-word" | "ascii-word"
|
|
346
|
-
reserved?: [&: string]
|
|
347
|
-
case?: close({
|
|
348
|
-
record?: %case
|
|
349
|
-
field?: %case
|
|
350
|
-
enum?: %case
|
|
351
|
-
member?: %case
|
|
352
|
-
const?: %case
|
|
353
|
-
func?: %case
|
|
354
|
-
param?: %case
|
|
355
|
-
alias?: %case
|
|
356
|
-
})
|
|
357
|
-
acronyms?: [&: %name]
|
|
358
|
-
})
|
|
359
|
-
types?: close({
|
|
360
|
-
prim?: { &: string }
|
|
361
|
-
list?: %form
|
|
362
|
-
map?: %form
|
|
363
|
-
opt?: %form
|
|
364
|
-
union?: %form
|
|
365
|
-
lit?: %form
|
|
366
|
-
})
|
|
367
|
-
banner?: string
|
|
368
|
-
})
|
|
369
|
-
|
|
370
|
-
profile: %profile
|
|
371
|
-
`;
|
|
372
|
-
// The text profile (RENDER.0.md D5): the profile of a fragment-only
|
|
373
|
-
// unit, and the fallback of every language without a lowering.
|
|
374
|
-
const STD_LANG_TEXT = String.raw `# aontu:lang/text --- THE TEXT PROFILE. The profile of a unit whose
|
|
375
|
-
# declarations are fragments and text escapes only: indentation, and
|
|
376
|
-
# nothing else, since a fold over fragments applies nothing else. Every
|
|
377
|
-
# language without a lowering renders under it (docs/design/RENDER.0.md
|
|
378
|
-
# D5), and a reference inline renders as its name, verbatim.
|
|
379
|
-
#
|
|
380
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
381
|
-
# canon-hash.
|
|
382
|
-
|
|
383
|
-
@"aontu:profile"
|
|
384
|
-
|
|
385
|
-
profile: { lang:"text" indent:{ unit:" " width:2 } }
|
|
386
|
-
`;
|
|
387
|
-
// THE TYPESCRIPT PROFILE (docs/design/RENDER.0.md D5, P5): the data the
|
|
388
|
-
// typescript lowering renders under -- two spaces, the JSDoc forms, the
|
|
389
|
-
// JavaScript string escapes by decimal code point, the reserved words,
|
|
390
|
-
// camel and pascal by role, no acronyms (TypeScript's `ledgerId` keeps
|
|
391
|
-
// its `Id`), and the type forms whose precedences put the parens in
|
|
392
|
-
// `(string | null)[]`. Byte-identical in both ports, pinned by hash.
|
|
393
|
-
const STD_LANG_TYPESCRIPT = String.raw `# aontu:lang/typescript --- THE TYPESCRIPT PROFILE. The data a unit of
|
|
394
|
-
# TypeScript renders under: indentation, the comment forms, the string
|
|
395
|
-
# quote and its escape table, the identifier rules and the type forms.
|
|
396
|
-
# The lowering of a declaration to an exported interface is code
|
|
397
|
-
# (docs/design/RENDER.0.md D5); everything the lowering reads without
|
|
398
|
-
# looking at the shape of a node is here.
|
|
399
|
-
#
|
|
400
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
401
|
-
# canon-hash.
|
|
402
|
-
|
|
403
|
-
@"aontu:profile"
|
|
404
|
-
|
|
405
|
-
profile: {
|
|
406
|
-
lang: "typescript"
|
|
407
|
-
lowering: "typescript"
|
|
408
|
-
indent: { unit:" " width:2 }
|
|
409
|
-
comment: line: prefix: "// "
|
|
410
|
-
comment: block: { open:"/*" prefix:" * " close:" */" }
|
|
411
|
-
comment: doc: { open:"/**" prefix:" * " close:" */" }
|
|
412
|
-
str: quote: "\""
|
|
413
|
-
str: escape: "8": "\\b"
|
|
414
|
-
str: escape: "9": "\\t"
|
|
415
|
-
str: escape: "10": "\\n"
|
|
416
|
-
str: escape: "12": "\\f"
|
|
417
|
-
str: escape: "13": "\\r"
|
|
418
|
-
str: escape: "34": "\\\""
|
|
419
|
-
str: escape: "92": "\\\\"
|
|
420
|
-
ident: {
|
|
421
|
-
chars: "ascii-word"
|
|
422
|
-
reserved: [
|
|
423
|
-
"await"
|
|
424
|
-
"break"
|
|
425
|
-
"case"
|
|
426
|
-
"catch"
|
|
427
|
-
"class"
|
|
428
|
-
"const"
|
|
429
|
-
"continue"
|
|
430
|
-
"debugger"
|
|
431
|
-
"default"
|
|
432
|
-
"delete"
|
|
433
|
-
"do"
|
|
434
|
-
"else"
|
|
435
|
-
"enum"
|
|
436
|
-
"export"
|
|
437
|
-
"extends"
|
|
438
|
-
"false"
|
|
439
|
-
"finally"
|
|
440
|
-
"for"
|
|
441
|
-
"function"
|
|
442
|
-
"if"
|
|
443
|
-
"implements"
|
|
444
|
-
"import"
|
|
445
|
-
"in"
|
|
446
|
-
"instanceof"
|
|
447
|
-
"interface"
|
|
448
|
-
"let"
|
|
449
|
-
"new"
|
|
450
|
-
"null"
|
|
451
|
-
"package"
|
|
452
|
-
"private"
|
|
453
|
-
"protected"
|
|
454
|
-
"public"
|
|
455
|
-
"return"
|
|
456
|
-
"static"
|
|
457
|
-
"super"
|
|
458
|
-
"switch"
|
|
459
|
-
"this"
|
|
460
|
-
"throw"
|
|
461
|
-
"true"
|
|
462
|
-
"try"
|
|
463
|
-
"typeof"
|
|
464
|
-
"var"
|
|
465
|
-
"void"
|
|
466
|
-
"while"
|
|
467
|
-
"with"
|
|
468
|
-
"yield"
|
|
469
|
-
]
|
|
470
|
-
case: record: "pascal"
|
|
471
|
-
case: field: "camel"
|
|
472
|
-
case: enum: "pascal"
|
|
473
|
-
case: member: "pascal"
|
|
474
|
-
case: const: "camel"
|
|
475
|
-
case: func: "camel"
|
|
476
|
-
case: param: "camel"
|
|
477
|
-
case: alias: "pascal"
|
|
478
|
-
acronyms: []
|
|
479
|
-
}
|
|
480
|
-
types: prim: string: "string"
|
|
481
|
-
types: prim: int: "number"
|
|
482
|
-
types: prim: bigint: "bigint"
|
|
483
|
-
types: prim: float: "number"
|
|
484
|
-
types: prim: decimal: "string"
|
|
485
|
-
types: prim: bool: "boolean"
|
|
486
|
-
types: prim: null: "null"
|
|
487
|
-
types: prim: any: "unknown"
|
|
488
|
-
types: list: { close:"[]" childPrec:2 }
|
|
489
|
-
types: map: { open:"Record<" close:">" }
|
|
490
|
-
types: opt: { close:" | null" prec:1 childPrec:2 }
|
|
491
|
-
types: union: { prec:1 childPrec:2 }
|
|
492
|
-
types: lit: prec: 1
|
|
493
|
-
banner: "Code generated by aontu from {path}. DO NOT EDIT."
|
|
494
|
-
}
|
|
495
|
-
`;
|
|
496
|
-
// THE GO PROFILE (docs/design/RENDER.0.md D5, P5): a tab, the line-comment
|
|
497
|
-
// doc form, the Go string escapes, the 25 keywords, pascal by role with
|
|
498
|
-
// the acronym set that makes `ledgerId` `LedgerID`, and the type forms
|
|
499
|
-
// -- `[]T`, `map[K]V`, `*T` -- none of which needs a paren.
|
|
500
|
-
// Byte-identical in both ports, pinned by hash.
|
|
501
|
-
const STD_LANG_GO = String.raw `# aontu:lang/go --- THE GO PROFILE. The data a unit of Go renders
|
|
502
|
-
# under: a tab of indentation, the comment forms, the string quote and
|
|
503
|
-
# its escape table, the identifier rules -- pascal by role, and the
|
|
504
|
-
# acronym set that spells ID and URL -- and the type forms. The lowering
|
|
505
|
-
# of a declaration to a struct type is code (docs/design/RENDER.0.md D5);
|
|
506
|
-
# everything the lowering reads without looking at the shape of a node
|
|
507
|
-
# is here.
|
|
508
|
-
#
|
|
509
|
-
# EXPERIMENTAL until the distribution layer can version it by
|
|
510
|
-
# canon-hash.
|
|
511
|
-
|
|
512
|
-
@"aontu:profile"
|
|
513
|
-
|
|
514
|
-
profile: {
|
|
515
|
-
lang: "go"
|
|
516
|
-
lowering: "go"
|
|
517
|
-
indent: { unit:"\t" width:1 }
|
|
518
|
-
comment: { line:prefix:"// " block:{ open:"/*" close:"*/" } doc:prefix:"// " }
|
|
519
|
-
str: quote: "\""
|
|
520
|
-
str: escape: "7": "\\a"
|
|
521
|
-
str: escape: "8": "\\b"
|
|
522
|
-
str: escape: "9": "\\t"
|
|
523
|
-
str: escape: "10": "\\n"
|
|
524
|
-
str: escape: "11": "\\v"
|
|
525
|
-
str: escape: "12": "\\f"
|
|
526
|
-
str: escape: "13": "\\r"
|
|
527
|
-
str: escape: "34": "\\\""
|
|
528
|
-
str: escape: "92": "\\\\"
|
|
529
|
-
ident: {
|
|
530
|
-
chars: "ascii-word"
|
|
531
|
-
reserved: [
|
|
532
|
-
"break"
|
|
533
|
-
"case"
|
|
534
|
-
"chan"
|
|
535
|
-
"const"
|
|
536
|
-
"continue"
|
|
537
|
-
"default"
|
|
538
|
-
"defer"
|
|
539
|
-
"else"
|
|
540
|
-
"fallthrough"
|
|
541
|
-
"for"
|
|
542
|
-
"func"
|
|
543
|
-
"go"
|
|
544
|
-
"goto"
|
|
545
|
-
"if"
|
|
546
|
-
"import"
|
|
547
|
-
"interface"
|
|
548
|
-
"map"
|
|
549
|
-
"package"
|
|
550
|
-
"range"
|
|
551
|
-
"return"
|
|
552
|
-
"select"
|
|
553
|
-
"struct"
|
|
554
|
-
"switch"
|
|
555
|
-
"type"
|
|
556
|
-
"var"
|
|
557
|
-
]
|
|
558
|
-
case: record: "pascal"
|
|
559
|
-
case: field: "pascal"
|
|
560
|
-
case: enum: "pascal"
|
|
561
|
-
case: member: "pascal"
|
|
562
|
-
case: const: "pascal"
|
|
563
|
-
case: func: "pascal"
|
|
564
|
-
case: param: "camel"
|
|
565
|
-
case: alias: "pascal"
|
|
566
|
-
acronyms: [
|
|
567
|
-
"ACL"
|
|
568
|
-
"API"
|
|
569
|
-
"ASCII"
|
|
570
|
-
"CPU"
|
|
571
|
-
"CSS"
|
|
572
|
-
"DNS"
|
|
573
|
-
"EOF"
|
|
574
|
-
"GUID"
|
|
575
|
-
"HTML"
|
|
576
|
-
"HTTP"
|
|
577
|
-
"HTTPS"
|
|
578
|
-
"ID"
|
|
579
|
-
"IP"
|
|
580
|
-
"JSON"
|
|
581
|
-
"LHS"
|
|
582
|
-
"QPS"
|
|
583
|
-
"RAM"
|
|
584
|
-
"RHS"
|
|
585
|
-
"RPC"
|
|
586
|
-
"SLA"
|
|
587
|
-
"SMTP"
|
|
588
|
-
"SQL"
|
|
589
|
-
"SSH"
|
|
590
|
-
"TCP"
|
|
591
|
-
"TLS"
|
|
592
|
-
"TTL"
|
|
593
|
-
"UDP"
|
|
594
|
-
"UI"
|
|
595
|
-
"UID"
|
|
596
|
-
"UUID"
|
|
597
|
-
"URI"
|
|
598
|
-
"URL"
|
|
599
|
-
"UTF8"
|
|
600
|
-
"VM"
|
|
601
|
-
"XML"
|
|
602
|
-
"XMPP"
|
|
603
|
-
"XSRF"
|
|
604
|
-
"XSS"
|
|
605
|
-
]
|
|
606
|
-
}
|
|
607
|
-
types: prim: string: "string"
|
|
608
|
-
types: prim: int: "int64"
|
|
609
|
-
types: prim: bigint: "string"
|
|
610
|
-
types: prim: float: "float64"
|
|
611
|
-
types: prim: decimal: "string"
|
|
612
|
-
types: prim: bool: "bool"
|
|
613
|
-
types: prim: null: "any"
|
|
614
|
-
types: prim: any: "any"
|
|
615
|
-
types: list: open: "[]"
|
|
616
|
-
types: map: open: "map["
|
|
617
|
-
types: opt: open: "*"
|
|
618
|
-
banner: "Code generated by aontu from {path}. DO NOT EDIT."
|
|
619
|
-
}
|
|
620
|
-
`;
|
|
621
|
-
exports.STD_SOURCES = {
|
|
622
|
-
'std/system': STD_SYSTEM,
|
|
623
|
-
'std/system.aon': STD_SYSTEM,
|
|
624
|
-
'std/view': STD_VIEW,
|
|
625
|
-
'std/view.aon': STD_VIEW,
|
|
626
|
-
'aontu:code': STD_CODE,
|
|
627
|
-
'aontu:lang/go': STD_LANG_GO,
|
|
628
|
-
'aontu:lang/text': STD_LANG_TEXT,
|
|
629
|
-
'aontu:lang/typescript': STD_LANG_TYPESCRIPT,
|
|
630
|
-
'aontu:profile': STD_PROFILE,
|
|
631
|
-
};
|
|
632
|
-
// The scheme of a language-supplied model, and the names it serves --
|
|
633
|
-
// the set the not-found message names, so a typo does not go looking
|
|
634
|
-
// on disk.
|
|
635
|
-
exports.AONTU_SCHEME = 'aontu:';
|
|
636
|
-
exports.AONTU_MODELS = Object.keys(exports.STD_SOURCES).filter((k) => k.startsWith(exports.AONTU_SCHEME)).sort();
|
|
637
|
-
//# sourceMappingURL=std.js.map
|