aontu 0.57.0 → 0.58.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 +2 -2
- package/dist/agentsmd.js +1 -1
- package/dist/alias.d.ts +3 -0
- package/dist/alias.js +59 -0
- package/dist/alias.js.map +1 -0
- package/dist/aontu.d.ts +4 -2
- package/dist/aontu.js +11 -3
- package/dist/aontu.js.map +1 -1
- package/dist/cli.d.ts +3 -1
- package/dist/cli.js +475 -3
- package/dist/cli.js.map +1 -1
- package/dist/ctx.d.ts +2 -0
- package/dist/ctx.js +1 -0
- package/dist/ctx.js.map +1 -1
- package/dist/format.js +8 -2
- package/dist/format.js.map +1 -1
- package/dist/hints.js +40 -9
- package/dist/hints.js.map +1 -1
- package/dist/lang.js +354 -57
- package/dist/lang.js.map +1 -1
- package/dist/lower.d.ts +20 -0
- package/dist/lower.js +575 -0
- package/dist/lower.js.map +1 -0
- package/dist/lsp.d.ts +1 -1
- package/dist/lsp.js +1 -1
- package/dist/lsp.js.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +40 -3
- package/dist/mcp.js.map +1 -1
- package/dist/render.d.ts +53 -0
- package/dist/render.js +542 -0
- package/dist/render.js.map +1 -0
- package/dist/sigdecl.js +1 -1
- package/dist/sigdecl.js.map +1 -1
- package/dist/std.d.ts +2 -0
- package/dist/std.js +498 -2
- package/dist/std.js.map +1 -1
- package/dist/template.d.ts +5 -0
- package/dist/template.js +257 -0
- package/dist/template.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/unify.js +43 -0
- package/dist/unify.js.map +1 -1
- package/dist/val/AggFuncVal.d.ts +1 -1
- package/dist/val/AggFuncVal.js +10 -21
- package/dist/val/AggFuncVal.js.map +1 -1
- package/dist/val/BagVal.js +1 -1
- package/dist/val/BagVal.js.map +1 -1
- package/dist/val/ConstraintVal.js +1 -1
- package/dist/val/EachFuncVal.d.ts +1 -1
- package/dist/val/EachFuncVal.js +8 -13
- package/dist/val/EachFuncVal.js.map +1 -1
- package/dist/val/EmitFuncVal.d.ts +23 -4
- package/dist/val/EmitFuncVal.js +298 -28
- package/dist/val/EmitFuncVal.js.map +1 -1
- package/dist/val/FilterFuncVal.js +8 -4
- package/dist/val/FilterFuncVal.js.map +1 -1
- package/dist/val/FormFuncVal.d.ts +14 -0
- package/dist/val/FormFuncVal.js +55 -0
- package/dist/val/FormFuncVal.js.map +1 -0
- package/dist/val/MapVal.d.ts +2 -1
- package/dist/val/MapVal.js +2 -1
- package/dist/val/MapVal.js.map +1 -1
- package/dist/val/PackFuncVal.d.ts +1 -1
- package/dist/val/PackFuncVal.js +22 -18
- package/dist/val/PackFuncVal.js.map +1 -1
- package/dist/val/PlaceVal.js +2 -1
- package/dist/val/PlaceVal.js.map +1 -1
- package/dist/val/RefVal.d.ts +3 -0
- package/dist/val/RefVal.js +156 -17
- package/dist/val/RefVal.js.map +1 -1
- package/dist/val/Val.d.ts +7 -1
- package/dist/val/Val.js +12 -1
- package/dist/val/Val.js.map +1 -1
- package/dist/val/members.d.ts +9 -0
- package/dist/val/members.js +52 -0
- package/dist/val/members.js.map +1 -0
- package/grammar/aontu.abnf +1 -1
- package/grammar/aontu.gbnf +1 -1
- package/grammar/aontu.lark +1 -1
- package/grammar/aontu.tmLanguage.json +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +4 -4
- package/skill/error-codes.md +1 -1
- package/skill/examples.md +1 -1
- package/skill/grammar-card.md +1 -1
- package/src/agentsmd.ts +1 -1
- package/src/alias.ts +112 -0
- package/src/aontu.ts +19 -2
- package/src/cli.ts +517 -3
- package/src/ctx.ts +13 -0
- package/src/format.ts +12 -2
- package/src/hints.ts +47 -9
- package/src/lang.ts +406 -62
- package/src/lower.ts +636 -0
- package/src/lsp.ts +1 -1
- package/src/mcp-server.ts +1 -1
- package/src/mcp.ts +43 -4
- package/src/render.ts +727 -0
- package/src/sigdecl.ts +1 -1
- package/src/std.ts +506 -1
- package/src/template.ts +291 -0
- package/src/unify.ts +47 -0
- package/src/val/AggFuncVal.ts +10 -21
- package/src/val/BagVal.ts +1 -1
- package/src/val/ConstraintVal.ts +1 -1
- package/src/val/EachFuncVal.ts +8 -16
- package/src/val/EmitFuncVal.ts +376 -39
- package/src/val/FilterFuncVal.ts +11 -4
- package/src/val/FormFuncVal.ts +119 -0
- package/src/val/MapVal.ts +3 -2
- package/src/val/PackFuncVal.ts +23 -19
- package/src/val/PlaceVal.ts +2 -1
- package/src/val/RefVal.ts +167 -18
- package/src/val/Val.ts +42 -1
- package/src/val/members.ts +86 -0
package/dist/std.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.STD_SOURCES = void 0;
|
|
4
|
+
exports.AONTU_MODELS = exports.AONTU_SCHEME = exports.STD_SOURCES = void 0;
|
|
5
5
|
// THE BUNDLED VOCABULARY (G4 phase 4,
|
|
6
6
|
// docs/capability-review/g4-identity-relations.md): `@"std/system"` is
|
|
7
7
|
// served from the engine itself — no filesystem, no package resolution
|
|
@@ -59,7 +59,7 @@ std: {
|
|
|
59
59
|
const STD_VIEW = `# std/view --- the FIGURE VOCABULARY (VIEWS.0.md, "6. The view
|
|
60
60
|
# document"). A view document declares its figures as data, and a
|
|
61
61
|
# declaration is just a map: this is the schema for one, so a typo is
|
|
62
|
-
# refused where every other mistake in an
|
|
62
|
+
# refused where every other mistake in an aontu document is refused --
|
|
63
63
|
# at evaluation, by unification -- rather than by the verb that reads
|
|
64
64
|
# it afterwards.
|
|
65
65
|
#
|
|
@@ -124,10 +124,506 @@ view: {
|
|
|
124
124
|
})
|
|
125
125
|
}
|
|
126
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
|
+
%ref = close({ k:"ref" name:%name unit?:string })
|
|
187
|
+
%leaf = %prim | %ref | %text
|
|
188
|
+
|
|
189
|
+
%type = %leaf
|
|
190
|
+
| close({ k:"list" of:%leaf })
|
|
191
|
+
| close({ k:"map" key:%leaf of:%leaf })
|
|
192
|
+
| close({ k:"opt" of:%leaf })
|
|
193
|
+
| close({ k:"union" of:[&: %leaf] })
|
|
194
|
+
| close({ k:"lit" of:[&: string | number | boolean | null] })
|
|
195
|
+
|
|
196
|
+
%field = close({
|
|
197
|
+
name: %name
|
|
198
|
+
type: %type
|
|
199
|
+
optional: *false | boolean
|
|
200
|
+
doc?: %doc
|
|
201
|
+
default?: string | number | boolean | null
|
|
202
|
+
check?: [&: %check]
|
|
203
|
+
rel?: close({ to:string name?:string })
|
|
204
|
+
x?: {}
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
%member = close({ name:%name value?:string | number doc?:%doc x?:{} })
|
|
208
|
+
%param = close({
|
|
209
|
+
name: %name
|
|
210
|
+
type: %type
|
|
211
|
+
default?: string | number | boolean | null
|
|
212
|
+
x?: {}
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
# THE FRAGMENT ALGEBRA. A line's inline pieces hold no terminator; a
|
|
216
|
+
# blank is its terminators alone; a raw is the one piece that may carry
|
|
217
|
+
# terminators, re-indented to its depth unless it says not to.
|
|
218
|
+
%inline = string & re("^[^\n\r]*$") | %ref
|
|
219
|
+
%line = close({ k:"line" at:*0 | integer & min(0) & max(64) of:[&: %inline] })
|
|
220
|
+
%blank = close({ k:"blank" n:*1 | integer & min(1) & max(16) })
|
|
221
|
+
%raw = close({
|
|
222
|
+
k: "raw"
|
|
223
|
+
at: *0 | integer & min(0) & max(64)
|
|
224
|
+
text: string
|
|
225
|
+
reindent: *true | boolean
|
|
226
|
+
})
|
|
227
|
+
%piece = %line | %blank | %raw | string & re("^[^\n\r]*$")
|
|
228
|
+
%frag = close({ k:"frag" of:[&: %piece] })
|
|
229
|
+
%body = %frag | close({ k:"abstract" })
|
|
230
|
+
|
|
231
|
+
%record = close({
|
|
232
|
+
k: "record"
|
|
233
|
+
name: %name
|
|
234
|
+
doc?: %doc
|
|
235
|
+
open: *false | boolean
|
|
236
|
+
fields: [&: %field]
|
|
237
|
+
entity?: string
|
|
238
|
+
check?: [&: %check]
|
|
239
|
+
x?: {}
|
|
240
|
+
})
|
|
241
|
+
%enum = close({ k:"enum" name:%name doc?:%doc members:[&: %member] x?:{} })
|
|
242
|
+
%alias = close({
|
|
243
|
+
k: "alias"
|
|
244
|
+
name: %name
|
|
245
|
+
doc?: %doc
|
|
246
|
+
type: %type
|
|
247
|
+
check?: [&: %check]
|
|
248
|
+
x?: {}
|
|
249
|
+
})
|
|
250
|
+
%const = close({
|
|
251
|
+
k: "const"
|
|
252
|
+
name: %name
|
|
253
|
+
doc?: %doc
|
|
254
|
+
type?: %type
|
|
255
|
+
value: string | number | boolean | null
|
|
256
|
+
x?: {}
|
|
257
|
+
})
|
|
258
|
+
%func = close({
|
|
259
|
+
k: "func"
|
|
260
|
+
name: %name
|
|
261
|
+
doc?: %doc
|
|
262
|
+
params: [&: %param]
|
|
263
|
+
returns?: %type
|
|
264
|
+
body: %body
|
|
265
|
+
x?: {}
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
%decl = %record | %enum | %alias | %const | %func | %text | %frag
|
|
269
|
+
|
|
270
|
+
%import = close({
|
|
271
|
+
from: string & length(min(1))
|
|
272
|
+
names?: [&: %name]
|
|
273
|
+
alias?: %name
|
|
274
|
+
x?: {}
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
%unit = close({
|
|
278
|
+
path: string & length(min(1))
|
|
279
|
+
lang: string & length(min(1))
|
|
280
|
+
pkg?: string
|
|
281
|
+
doc?: %doc
|
|
282
|
+
imports?: [&: %import]
|
|
283
|
+
decls: [&: %decl]
|
|
284
|
+
profile?: {}
|
|
285
|
+
x?: {}
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
%source = close({ path?:string hash?:string & re("^aon1-[A-Za-z0-9_-]+$") })
|
|
289
|
+
|
|
290
|
+
code: close({ source?:%source units:[&: %unit] })
|
|
291
|
+
`;
|
|
292
|
+
const STD_PROFILE = String.raw `# aontu:profile --- THE PROFILE VOCABULARY. A profile is the data
|
|
293
|
+
# 'aontu render' applies to a unit of one language, and it is DATA and
|
|
294
|
+
# only data: a field belongs here only if the renderer applies it
|
|
295
|
+
# without looking at the shape of any node. Anything else is a lowering
|
|
296
|
+
# and lives in the transform.
|
|
297
|
+
#
|
|
298
|
+
# @"aontu:profile"
|
|
299
|
+
# profile: { lang: "python", indent: { unit: " ", width: 4 } }
|
|
300
|
+
#
|
|
301
|
+
# Three profiles are bundled with the engine -- aontu:lang/typescript,
|
|
302
|
+
# aontu:lang/go and aontu:lang/text -- and a unit is matched to one by
|
|
303
|
+
# its 'lang'. A fragment-only unit needs nothing beyond 'indent'.
|
|
304
|
+
#
|
|
305
|
+
# THE ROOT IS NOT type()-MARKED, for the reason aontu:code's is not:
|
|
306
|
+
# 'aontu render' reads a profile through generate().
|
|
307
|
+
#
|
|
308
|
+
# EXPERIMENTAL until the distribution layer can version it by
|
|
309
|
+
# canon-hash.
|
|
310
|
+
|
|
311
|
+
%name = string & re("^[A-Za-z_][A-Za-z0-9_]*$")
|
|
312
|
+
|
|
313
|
+
%case = "as-is" | "camel" | "pascal" | "snake" | "screaming" | "kebab"
|
|
314
|
+
|
|
315
|
+
%comment = close({ open?:string prefix?:string close?:string })
|
|
316
|
+
|
|
317
|
+
%form = close({
|
|
318
|
+
open: *"" | string
|
|
319
|
+
close: *"" | string
|
|
320
|
+
prec: *9 | integer & min(0) & max(9)
|
|
321
|
+
childPrec: *0 | integer & min(0) & max(9)
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
%profile = close({
|
|
325
|
+
lang: string & length(min(1))
|
|
326
|
+
lowering?: "typescript" | "go"
|
|
327
|
+
indent: close({
|
|
328
|
+
unit: *" " | string & length(min(1))
|
|
329
|
+
width: *2 | integer & min(0) & max(16)
|
|
330
|
+
})
|
|
331
|
+
comment?: close({ line?:%comment block?:%comment doc?:%comment })
|
|
332
|
+
str?: close({
|
|
333
|
+
quote: *"\"" | string & length(min(1) & max(1))
|
|
334
|
+
escape: { &: string }
|
|
335
|
+
})
|
|
336
|
+
ident?: close({
|
|
337
|
+
chars: *"ascii-word" | "ascii-word"
|
|
338
|
+
reserved?: [&: string]
|
|
339
|
+
case?: close({
|
|
340
|
+
record?: %case
|
|
341
|
+
field?: %case
|
|
342
|
+
enum?: %case
|
|
343
|
+
member?: %case
|
|
344
|
+
const?: %case
|
|
345
|
+
func?: %case
|
|
346
|
+
param?: %case
|
|
347
|
+
alias?: %case
|
|
348
|
+
})
|
|
349
|
+
acronyms?: [&: %name]
|
|
350
|
+
})
|
|
351
|
+
types?: close({
|
|
352
|
+
prim?: { &: string }
|
|
353
|
+
list?: %form
|
|
354
|
+
map?: %form
|
|
355
|
+
opt?: %form
|
|
356
|
+
union?: %form
|
|
357
|
+
lit?: %form
|
|
358
|
+
})
|
|
359
|
+
banner?: string
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
profile: %profile
|
|
363
|
+
`;
|
|
364
|
+
// The text profile (RENDER.0.md D5): the profile of a fragment-only
|
|
365
|
+
// unit, and the fallback of every language without a lowering.
|
|
366
|
+
const STD_LANG_TEXT = String.raw `# aontu:lang/text --- THE TEXT PROFILE. The profile of a unit whose
|
|
367
|
+
# declarations are fragments and text escapes only: indentation, and
|
|
368
|
+
# nothing else, since a fold over fragments applies nothing else. Every
|
|
369
|
+
# language without a lowering renders under it (docs/design/RENDER.0.md
|
|
370
|
+
# D5), and a reference inline renders as its name, verbatim.
|
|
371
|
+
#
|
|
372
|
+
# EXPERIMENTAL until the distribution layer can version it by
|
|
373
|
+
# canon-hash.
|
|
374
|
+
|
|
375
|
+
@"aontu:profile"
|
|
376
|
+
|
|
377
|
+
profile: { lang:"text" indent:{ unit:" " width:2 } }
|
|
378
|
+
`;
|
|
379
|
+
// THE TYPESCRIPT PROFILE (docs/design/RENDER.0.md D5, P5): the data the
|
|
380
|
+
// typescript lowering renders under -- two spaces, the JSDoc forms, the
|
|
381
|
+
// JavaScript string escapes by decimal code point, the reserved words,
|
|
382
|
+
// camel and pascal by role, no acronyms (TypeScript's `ledgerId` keeps
|
|
383
|
+
// its `Id`), and the type forms whose precedences put the parens in
|
|
384
|
+
// `(string | null)[]`. Byte-identical in both ports, pinned by hash.
|
|
385
|
+
const STD_LANG_TYPESCRIPT = String.raw `# aontu:lang/typescript --- THE TYPESCRIPT PROFILE. The data a unit of
|
|
386
|
+
# TypeScript renders under: indentation, the comment forms, the string
|
|
387
|
+
# quote and its escape table, the identifier rules and the type forms.
|
|
388
|
+
# The lowering of a declaration to an exported interface is code
|
|
389
|
+
# (docs/design/RENDER.0.md D5); everything the lowering reads without
|
|
390
|
+
# looking at the shape of a node is here.
|
|
391
|
+
#
|
|
392
|
+
# EXPERIMENTAL until the distribution layer can version it by
|
|
393
|
+
# canon-hash.
|
|
394
|
+
|
|
395
|
+
@"aontu:profile"
|
|
396
|
+
|
|
397
|
+
profile: {
|
|
398
|
+
lang: "typescript"
|
|
399
|
+
lowering: "typescript"
|
|
400
|
+
indent: { unit:" " width:2 }
|
|
401
|
+
comment: line: prefix: "// "
|
|
402
|
+
comment: block: { open:"/*" prefix:" * " close:" */" }
|
|
403
|
+
comment: doc: { open:"/**" prefix:" * " close:" */" }
|
|
404
|
+
str: quote: "\""
|
|
405
|
+
str: escape: "8": "\\b"
|
|
406
|
+
str: escape: "9": "\\t"
|
|
407
|
+
str: escape: "10": "\\n"
|
|
408
|
+
str: escape: "12": "\\f"
|
|
409
|
+
str: escape: "13": "\\r"
|
|
410
|
+
str: escape: "34": "\\\""
|
|
411
|
+
str: escape: "92": "\\\\"
|
|
412
|
+
ident: {
|
|
413
|
+
chars: "ascii-word"
|
|
414
|
+
reserved: [
|
|
415
|
+
"await"
|
|
416
|
+
"break"
|
|
417
|
+
"case"
|
|
418
|
+
"catch"
|
|
419
|
+
"class"
|
|
420
|
+
"const"
|
|
421
|
+
"continue"
|
|
422
|
+
"debugger"
|
|
423
|
+
"default"
|
|
424
|
+
"delete"
|
|
425
|
+
"do"
|
|
426
|
+
"else"
|
|
427
|
+
"enum"
|
|
428
|
+
"export"
|
|
429
|
+
"extends"
|
|
430
|
+
"false"
|
|
431
|
+
"finally"
|
|
432
|
+
"for"
|
|
433
|
+
"function"
|
|
434
|
+
"if"
|
|
435
|
+
"implements"
|
|
436
|
+
"import"
|
|
437
|
+
"in"
|
|
438
|
+
"instanceof"
|
|
439
|
+
"interface"
|
|
440
|
+
"let"
|
|
441
|
+
"new"
|
|
442
|
+
"null"
|
|
443
|
+
"package"
|
|
444
|
+
"private"
|
|
445
|
+
"protected"
|
|
446
|
+
"public"
|
|
447
|
+
"return"
|
|
448
|
+
"static"
|
|
449
|
+
"super"
|
|
450
|
+
"switch"
|
|
451
|
+
"this"
|
|
452
|
+
"throw"
|
|
453
|
+
"true"
|
|
454
|
+
"try"
|
|
455
|
+
"typeof"
|
|
456
|
+
"var"
|
|
457
|
+
"void"
|
|
458
|
+
"while"
|
|
459
|
+
"with"
|
|
460
|
+
"yield"
|
|
461
|
+
]
|
|
462
|
+
case: record: "pascal"
|
|
463
|
+
case: field: "camel"
|
|
464
|
+
case: enum: "pascal"
|
|
465
|
+
case: member: "pascal"
|
|
466
|
+
case: const: "camel"
|
|
467
|
+
case: func: "camel"
|
|
468
|
+
case: param: "camel"
|
|
469
|
+
case: alias: "pascal"
|
|
470
|
+
acronyms: []
|
|
471
|
+
}
|
|
472
|
+
types: prim: string: "string"
|
|
473
|
+
types: prim: int: "number"
|
|
474
|
+
types: prim: bigint: "bigint"
|
|
475
|
+
types: prim: float: "number"
|
|
476
|
+
types: prim: decimal: "string"
|
|
477
|
+
types: prim: bool: "boolean"
|
|
478
|
+
types: prim: null: "null"
|
|
479
|
+
types: prim: any: "unknown"
|
|
480
|
+
types: list: { close:"[]" childPrec:2 }
|
|
481
|
+
types: map: { open:"Record<" close:">" }
|
|
482
|
+
types: opt: { close:" | null" prec:1 childPrec:2 }
|
|
483
|
+
types: union: { prec:1 childPrec:2 }
|
|
484
|
+
types: lit: prec: 1
|
|
485
|
+
banner: "Code generated by aontu from {path}. DO NOT EDIT."
|
|
486
|
+
}
|
|
487
|
+
`;
|
|
488
|
+
// THE GO PROFILE (docs/design/RENDER.0.md D5, P5): a tab, the line-comment
|
|
489
|
+
// doc form, the Go string escapes, the 25 keywords, pascal by role with
|
|
490
|
+
// the acronym set that makes `ledgerId` `LedgerID`, and the type forms
|
|
491
|
+
// -- `[]T`, `map[K]V`, `*T` -- none of which needs a paren.
|
|
492
|
+
// Byte-identical in both ports, pinned by hash.
|
|
493
|
+
const STD_LANG_GO = String.raw `# aontu:lang/go --- THE GO PROFILE. The data a unit of Go renders
|
|
494
|
+
# under: a tab of indentation, the comment forms, the string quote and
|
|
495
|
+
# its escape table, the identifier rules -- pascal by role, and the
|
|
496
|
+
# acronym set that spells ID and URL -- and the type forms. The lowering
|
|
497
|
+
# of a declaration to a struct type is code (docs/design/RENDER.0.md D5);
|
|
498
|
+
# everything the lowering reads without looking at the shape of a node
|
|
499
|
+
# is here.
|
|
500
|
+
#
|
|
501
|
+
# EXPERIMENTAL until the distribution layer can version it by
|
|
502
|
+
# canon-hash.
|
|
503
|
+
|
|
504
|
+
@"aontu:profile"
|
|
505
|
+
|
|
506
|
+
profile: {
|
|
507
|
+
lang: "go"
|
|
508
|
+
lowering: "go"
|
|
509
|
+
indent: { unit:"\t" width:1 }
|
|
510
|
+
comment: { line:prefix:"// " block:{ open:"/*" close:"*/" } doc:prefix:"// " }
|
|
511
|
+
str: quote: "\""
|
|
512
|
+
str: escape: "7": "\\a"
|
|
513
|
+
str: escape: "8": "\\b"
|
|
514
|
+
str: escape: "9": "\\t"
|
|
515
|
+
str: escape: "10": "\\n"
|
|
516
|
+
str: escape: "11": "\\v"
|
|
517
|
+
str: escape: "12": "\\f"
|
|
518
|
+
str: escape: "13": "\\r"
|
|
519
|
+
str: escape: "34": "\\\""
|
|
520
|
+
str: escape: "92": "\\\\"
|
|
521
|
+
ident: {
|
|
522
|
+
chars: "ascii-word"
|
|
523
|
+
reserved: [
|
|
524
|
+
"break"
|
|
525
|
+
"case"
|
|
526
|
+
"chan"
|
|
527
|
+
"const"
|
|
528
|
+
"continue"
|
|
529
|
+
"default"
|
|
530
|
+
"defer"
|
|
531
|
+
"else"
|
|
532
|
+
"fallthrough"
|
|
533
|
+
"for"
|
|
534
|
+
"func"
|
|
535
|
+
"go"
|
|
536
|
+
"goto"
|
|
537
|
+
"if"
|
|
538
|
+
"import"
|
|
539
|
+
"interface"
|
|
540
|
+
"map"
|
|
541
|
+
"package"
|
|
542
|
+
"range"
|
|
543
|
+
"return"
|
|
544
|
+
"select"
|
|
545
|
+
"struct"
|
|
546
|
+
"switch"
|
|
547
|
+
"type"
|
|
548
|
+
"var"
|
|
549
|
+
]
|
|
550
|
+
case: record: "pascal"
|
|
551
|
+
case: field: "pascal"
|
|
552
|
+
case: enum: "pascal"
|
|
553
|
+
case: member: "pascal"
|
|
554
|
+
case: const: "pascal"
|
|
555
|
+
case: func: "pascal"
|
|
556
|
+
case: param: "camel"
|
|
557
|
+
case: alias: "pascal"
|
|
558
|
+
acronyms: [
|
|
559
|
+
"ACL"
|
|
560
|
+
"API"
|
|
561
|
+
"ASCII"
|
|
562
|
+
"CPU"
|
|
563
|
+
"CSS"
|
|
564
|
+
"DNS"
|
|
565
|
+
"EOF"
|
|
566
|
+
"GUID"
|
|
567
|
+
"HTML"
|
|
568
|
+
"HTTP"
|
|
569
|
+
"HTTPS"
|
|
570
|
+
"ID"
|
|
571
|
+
"IP"
|
|
572
|
+
"JSON"
|
|
573
|
+
"LHS"
|
|
574
|
+
"QPS"
|
|
575
|
+
"RAM"
|
|
576
|
+
"RHS"
|
|
577
|
+
"RPC"
|
|
578
|
+
"SLA"
|
|
579
|
+
"SMTP"
|
|
580
|
+
"SQL"
|
|
581
|
+
"SSH"
|
|
582
|
+
"TCP"
|
|
583
|
+
"TLS"
|
|
584
|
+
"TTL"
|
|
585
|
+
"UDP"
|
|
586
|
+
"UI"
|
|
587
|
+
"UID"
|
|
588
|
+
"UUID"
|
|
589
|
+
"URI"
|
|
590
|
+
"URL"
|
|
591
|
+
"UTF8"
|
|
592
|
+
"VM"
|
|
593
|
+
"XML"
|
|
594
|
+
"XMPP"
|
|
595
|
+
"XSRF"
|
|
596
|
+
"XSS"
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
types: prim: string: "string"
|
|
600
|
+
types: prim: int: "int64"
|
|
601
|
+
types: prim: bigint: "string"
|
|
602
|
+
types: prim: float: "float64"
|
|
603
|
+
types: prim: decimal: "string"
|
|
604
|
+
types: prim: bool: "bool"
|
|
605
|
+
types: prim: null: "any"
|
|
606
|
+
types: prim: any: "any"
|
|
607
|
+
types: list: open: "[]"
|
|
608
|
+
types: map: open: "map["
|
|
609
|
+
types: opt: open: "*"
|
|
610
|
+
banner: "Code generated by aontu from {path}. DO NOT EDIT."
|
|
611
|
+
}
|
|
612
|
+
`;
|
|
127
613
|
exports.STD_SOURCES = {
|
|
128
614
|
'std/system': STD_SYSTEM,
|
|
129
615
|
'std/system.aon': STD_SYSTEM,
|
|
130
616
|
'std/view': STD_VIEW,
|
|
131
617
|
'std/view.aon': STD_VIEW,
|
|
618
|
+
'aontu:code': STD_CODE,
|
|
619
|
+
'aontu:lang/go': STD_LANG_GO,
|
|
620
|
+
'aontu:lang/text': STD_LANG_TEXT,
|
|
621
|
+
'aontu:lang/typescript': STD_LANG_TYPESCRIPT,
|
|
622
|
+
'aontu:profile': STD_PROFILE,
|
|
132
623
|
};
|
|
624
|
+
// The scheme of a language-supplied model, and the names it serves --
|
|
625
|
+
// the set the not-found message names, so a typo does not go looking
|
|
626
|
+
// on disk.
|
|
627
|
+
exports.AONTU_SCHEME = 'aontu:';
|
|
628
|
+
exports.AONTU_MODELS = Object.keys(exports.STD_SOURCES).filter((k) => k.startsWith(exports.AONTU_SCHEME)).sort();
|
|
133
629
|
//# sourceMappingURL=std.js.map
|
package/dist/std.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"std.js","sourceRoot":"","sources":["../src/std.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,sCAAsC;AACtC,uEAAuE;AACvE,uEAAuE;AACvE,mEAAmE;AACnE,sEAAsE;AACtE,4BAA4B;AAC5B,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,oEAAoE;AACpE,uEAAuE;AACvE,qCAAqC;AAErC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;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path: string): string;
|
|
3
|
+
declare function desugarTemplate(src: string, marker?: string): string;
|
|
4
|
+
declare function resugarTemplate(src: string, marker?: string): string;
|
|
5
|
+
export { desugarTemplate, resugarTemplate, markerFor, DEFAULT_MARKER, };
|