@nola-lang/compiler 0.1.0-alpha.0 → 0.1.2
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/LICENSE +201 -21
- package/dist/ambient-stub.d.ts +1 -1
- package/dist/ambient-stub.d.ts.map +1 -1
- package/dist/ambient-stub.js +17 -3
- package/dist/ambient-stub.js.map +1 -1
- package/dist/lower/{Lowerer.d.ts → lowerer.d.ts} +34 -2
- package/dist/lower/lowerer.d.ts.map +1 -0
- package/dist/lower/{Lowerer.js → lowerer.js} +201 -33
- package/dist/lower/lowerer.js.map +1 -0
- package/dist/lower/templates.d.ts +58 -4
- package/dist/lower/templates.d.ts.map +1 -1
- package/dist/lower/templates.js +65 -9
- package/dist/lower/templates.js.map +1 -1
- package/dist/spans.d.ts +14 -3
- package/dist/spans.d.ts.map +1 -1
- package/dist/spans.js +8 -6
- package/dist/spans.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +7 -6
- package/dist/lower/Lowerer.d.ts.map +0 -1
- package/dist/lower/Lowerer.js.map +0 -1
- package/dist/lower/lower.d.ts +0 -2
- package/dist/lower/lower.d.ts.map +0 -1
- package/dist/lower/lower.js +0 -319
- package/dist/lower/lower.js.map +0 -1
- package/dist/lower.d.ts +0 -4
- package/dist/lower.d.ts.map +0 -1
- package/dist/lower.js +0 -322
- package/dist/lower.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Codes, children, } from "@nola-lang/ast";
|
|
1
|
+
import { Codes, children, walk, } from "@nola-lang/ast";
|
|
2
2
|
import { companionSpecifierFor } from "../companion-name.js";
|
|
3
3
|
import { collectTypeRegistry } from "../schema.js";
|
|
4
4
|
import { buildAccessorPlan, collectTypeImports, deriveTypeExpr, } from "../schema-expr.js";
|
|
5
5
|
import { anchorInsertedLines, SpanRecorder } from "../spans.js";
|
|
6
|
-
import { ASK_OPEN, askClose, CALL_INTENT_CLOSE, callIntentArgsHead, callIntentOpen, callIntentTypeText, companionImportDecl, EXTRACT_DEFAULT_TYPE_EXPR, EXTRACT_DEFAULT_TYPE_TEXT, extractClose, extractOpen, FMT_CLOSE, FMT_OPEN, invocationArgEntry, invocationClose, invocationOpen, runtimeImport, typeAccessorDecl, typeArgsText, } from "./templates.js";
|
|
6
|
+
import { ASK_OPEN, askClose, BROKEN_CONSTRUCT, CALL_INTENT_CLOSE, callIntentArgsHead, callIntentOpen, callIntentTypeText, companionImportDecl, EXTRACT_DEFAULT_TYPE_EXPR, EXTRACT_DEFAULT_TYPE_TEXT, extractClose, extractOpen, extractOpenTemplate, FMT_CLOSE, FMT_OPEN, invocationArgEntry, invocationClose, invocationOpen, rawTemplateText, runtimeImport, SCOPE_PARAM, TEMPLATE_OPEN, templateCopy, typeAccessorDecl, typeArgsText, } from "./templates.js";
|
|
7
7
|
export class Lowerer {
|
|
8
8
|
s;
|
|
9
9
|
source;
|
|
@@ -15,13 +15,27 @@ export class Lowerer {
|
|
|
15
15
|
diagnostics = [];
|
|
16
16
|
meta = { nolaFunctions: [] };
|
|
17
17
|
usedRuntime = false;
|
|
18
|
+
/**
|
|
19
|
+
* Where a `${.member}` scope access may appear right now: "inplace" — the
|
|
20
|
+
* enclosing instruction literal stays where it is (extractor), so the scope
|
|
21
|
+
* parameter is inserted before the dot here; "copy" — the literal is copied
|
|
22
|
+
* elsewhere (marker / call hint) and the copy builder did the insertion;
|
|
23
|
+
* "none" — not inside a Nola instruction literal (NOLA2009).
|
|
24
|
+
*/
|
|
25
|
+
scopeSite = "none";
|
|
26
|
+
/**
|
|
27
|
+
* True while visiting the holes of a COPIED instruction literal (marker /
|
|
28
|
+
* call hint). Nola constructs there have nowhere to lower to — the literal
|
|
29
|
+
* is re-emitted from source bytes — so they are NOLA2010.
|
|
30
|
+
*/
|
|
31
|
+
inCopiedHole = false;
|
|
18
32
|
/** named types needing a __nola_type_<Name> accessor in the appendix, in first-use order */
|
|
19
33
|
typeAccessors = new Map();
|
|
20
34
|
/** local binding name -> companion import emitted in the appendix */
|
|
21
35
|
companionImports = new Map();
|
|
22
36
|
/** shared derivation context (registry, imports, display file, bare ref names) */
|
|
23
37
|
deriveCtx;
|
|
24
|
-
/** policy for underivable
|
|
38
|
+
/** policy for underivable `.`-contextual param types (compiler.underivableContextType) */
|
|
25
39
|
underivableContextType;
|
|
26
40
|
constructor(source, file, ast, displayFile, options = {}) {
|
|
27
41
|
this.s = new SpanRecorder(source);
|
|
@@ -82,7 +96,7 @@ export class Lowerer {
|
|
|
82
96
|
this.diag(Codes.UnsupportedIntentType, e.message, e.node);
|
|
83
97
|
}
|
|
84
98
|
/**
|
|
85
|
-
* A
|
|
99
|
+
* A `.`-contextual param's type failed to derive (shallowly or in its
|
|
86
100
|
* accessor plan). Resolve it per the configured policy; the returned expr
|
|
87
101
|
* (if any) replaces the failed one.
|
|
88
102
|
*/
|
|
@@ -128,15 +142,42 @@ export class Lowerer {
|
|
|
128
142
|
visit(node, inNolaFnBody, topLevel) {
|
|
129
143
|
switch (node.type) {
|
|
130
144
|
case "NolaExtractExpression": {
|
|
145
|
+
if (this.inCopiedHole) {
|
|
146
|
+
this.diagCopiedHole(node);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
131
149
|
const extract = node;
|
|
132
|
-
// Tolerant-parse placeholder: diagnostic already recorded
|
|
133
|
-
//
|
|
134
|
-
|
|
150
|
+
// Tolerant-parse placeholder: the diagnostic is already recorded, so
|
|
151
|
+
// this only has to keep the generated text sane for the editor. The
|
|
152
|
+
// marker's own bytes would otherwise leave a dot at the cursor and TS
|
|
153
|
+
// would answer the next `.`-triggered completion with the global scope.
|
|
154
|
+
if (extract.nolaError || !extract.quasi) {
|
|
155
|
+
this.s.overwrite(node.start, node.end, BROKEN_CONSTRUCT, { broken: true });
|
|
135
156
|
return;
|
|
157
|
+
}
|
|
136
158
|
this.lowerExtract(extract, inNolaFnBody);
|
|
137
159
|
return;
|
|
138
160
|
}
|
|
161
|
+
case "NolaScopeAccess": {
|
|
162
|
+
if (this.scopeSite === "none") {
|
|
163
|
+
this.diag(Codes.ScopeAccessOutsideTemplate,
|
|
164
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: literal ${...} in a diagnostic message
|
|
165
|
+
"`${.member}` scope access is only allowed inside a Nola instruction template (infer-function marker, extractor prompt, call-intent hint).", node);
|
|
166
|
+
this.s.overwrite(node.start, node.end, BROKEN_CONSTRUCT, { broken: true });
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// In place: `.args` → `__nola_s.args`; the dot and member stay verbatim
|
|
170
|
+
// (a half-typed `${.` placeholder gets the prefix too, so TS answers
|
|
171
|
+
// completion after the dot). Copied literals were prefixed by the copy.
|
|
172
|
+
if (this.scopeSite === "inplace")
|
|
173
|
+
this.s.appendLeft(node.start, SCOPE_PARAM);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
139
176
|
case "NolaAskExpression": {
|
|
177
|
+
if (this.inCopiedHole) {
|
|
178
|
+
this.diagCopiedHole(node);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
140
181
|
const ask = node;
|
|
141
182
|
if (!inNolaFnBody) {
|
|
142
183
|
this.diag(Codes.AskOutsideNolaFunction, "`ask` is only allowed directly inside an infer function body.", node);
|
|
@@ -174,11 +215,36 @@ export class Lowerer {
|
|
|
174
215
|
case "CallExpression": {
|
|
175
216
|
const call = node;
|
|
176
217
|
if (call.callee.type === "TaggedTemplateExpression") {
|
|
218
|
+
if (this.inCopiedHole) {
|
|
219
|
+
this.diagCopiedHole(node);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
this.lowerCallIntent(call, inNolaFnBody);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// Sigil-less form: extractor args imply the call intent. Simple
|
|
226
|
+
// callees only — `new`, optional calls, super(), and exotic callees
|
|
227
|
+
// (call results, parenthesized exprs) stay plain calls; the sigil
|
|
228
|
+
// form keeps its wider callee latitude.
|
|
229
|
+
if ((call.callee.type === "Identifier" || call.callee.type === "MemberExpression") &&
|
|
230
|
+
call.arguments.some((a) => this.hasExtractorSlot(a))) {
|
|
177
231
|
this.lowerCallIntent(call, inNolaFnBody);
|
|
178
232
|
return;
|
|
179
233
|
}
|
|
180
234
|
break;
|
|
181
235
|
}
|
|
236
|
+
case "VariableDeclarator": {
|
|
237
|
+
// Reserved contextual binding (`const .x`, NOLA1014): the parser kept
|
|
238
|
+
// the declarator and parked the marker span on its id. Strict mode
|
|
239
|
+
// never gets here (raise throws); in tolerant mode the dot must not
|
|
240
|
+
// reach the generated TS, and `broken` opts the cursor position out of
|
|
241
|
+
// completion exactly as the parameter marker does.
|
|
242
|
+
const id = node.id;
|
|
243
|
+
if (id?.nolaReservedMarker) {
|
|
244
|
+
this.s.overwrite(id.nolaReservedMarker.start, id.nolaReservedMarker.end, "", { broken: true });
|
|
245
|
+
}
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
182
248
|
default:
|
|
183
249
|
break;
|
|
184
250
|
}
|
|
@@ -194,6 +260,65 @@ export class Lowerer {
|
|
|
194
260
|
this.visit(child, isFunctionScope ? false : inNolaFnBody, nextTopLevel);
|
|
195
261
|
}
|
|
196
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Sigil-less call-intent detection (2026-08-14 spec): a well-formed extractor
|
|
265
|
+
* in a slot position — a direct argument, or nested at any depth inside plain
|
|
266
|
+
* object/array literals (the same walk checkCallIntentArg performs). Tolerant
|
|
267
|
+
* placeholders (nolaError) do NOT count: a half-typed `f(..` stays a plain
|
|
268
|
+
* call, so the editor never lowers a call intent around a broken slot.
|
|
269
|
+
*/
|
|
270
|
+
hasExtractorSlot(node) {
|
|
271
|
+
if (node.type === "NolaExtractExpression") {
|
|
272
|
+
return !node.nolaError;
|
|
273
|
+
}
|
|
274
|
+
if (node.type === "ObjectExpression") {
|
|
275
|
+
return node.properties.some((p) => p.type === "ObjectProperty" && this.hasExtractorSlot(p.value));
|
|
276
|
+
}
|
|
277
|
+
if (node.type === "ArrayExpression") {
|
|
278
|
+
return node.elements.some((el) => el != null && this.hasExtractorSlot(el));
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
diagCopiedHole(node) {
|
|
283
|
+
this.diag(Codes.NolaConstructInMarker, "Nola constructs are not allowed inside an infer-function marker or call-intent hint hole.", node);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The instruction field of a copied instruction literal (marker / call hint):
|
|
287
|
+
* prose → JSON string; lexical holes → a template literal with fmt-wrapped
|
|
288
|
+
* holes; `${.member}` holes → the raw text as the instruction plus the
|
|
289
|
+
* template closure. Anchors point back at the literal's verbatim runs.
|
|
290
|
+
*/
|
|
291
|
+
instructionFieldFor(quasi, hasScopeAccess, cooked) {
|
|
292
|
+
if (quasi.expressions.length === 0)
|
|
293
|
+
return { field: JSON.stringify(cooked), copyText: "", anchors: [], holes: [] };
|
|
294
|
+
const scopeNodes = [];
|
|
295
|
+
if (hasScopeAccess) {
|
|
296
|
+
walk(quasi, (n) => {
|
|
297
|
+
if (n.type === "NolaScopeAccess")
|
|
298
|
+
scopeNodes.push(n);
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
const copy = templateCopy(this.source, quasi, scopeNodes, hasScopeAccess ? "scope" : "fmt");
|
|
302
|
+
const field = hasScopeAccess
|
|
303
|
+
? `${JSON.stringify(rawTemplateText(this.source, quasi))}, ${TEMPLATE_OPEN}${copy.text}`
|
|
304
|
+
: copy.text;
|
|
305
|
+
return { field, copyText: copy.text, anchors: copy.anchors, holes: quasi.expressions };
|
|
306
|
+
}
|
|
307
|
+
/** Visit the holes of a copied literal only to diagnose (NOLA2010 / NOLA2009) — the copy is already built. */
|
|
308
|
+
visitCopiedHoles(holes, inNolaFnBody) {
|
|
309
|
+
const prevSite = this.scopeSite;
|
|
310
|
+
const prevHole = this.inCopiedHole;
|
|
311
|
+
this.scopeSite = "copy";
|
|
312
|
+
this.inCopiedHole = true;
|
|
313
|
+
try {
|
|
314
|
+
for (const e of holes)
|
|
315
|
+
this.visit(e, inNolaFnBody, false);
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
this.scopeSite = prevSite;
|
|
319
|
+
this.inCopiedHole = prevHole;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
197
322
|
lowerInferFunction(fn) {
|
|
198
323
|
const infer = fn.nolaInfer;
|
|
199
324
|
if (!infer)
|
|
@@ -201,14 +326,14 @@ export class Lowerer {
|
|
|
201
326
|
const name = fn.id?.name ?? "anonymous";
|
|
202
327
|
// Removes `infer ` including trailing whitespace up to `function`.
|
|
203
328
|
this.s.remove(infer.start, infer.end);
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
this.s.remove(
|
|
329
|
+
const marker = fn.nolaMarker;
|
|
330
|
+
if (marker)
|
|
331
|
+
this.s.remove(marker.start, marker.end);
|
|
207
332
|
const body = fn.body;
|
|
208
333
|
if (!body)
|
|
209
334
|
return;
|
|
210
335
|
// Harvest params into FunctionScopeInit args: every named param contributes
|
|
211
|
-
// name (+ InferType when derivable); only
|
|
336
|
+
// name (+ InferType when derivable); only `.`-prefixed params contribute
|
|
212
337
|
// the live value. Plain params with underivable/unannotated types are
|
|
213
338
|
// silently omitted in every mode — their type never describes a live value.
|
|
214
339
|
// Contextual params follow the underivableContextType policy: a value the
|
|
@@ -217,11 +342,22 @@ export class Lowerer {
|
|
|
217
342
|
const argEntries = [];
|
|
218
343
|
const paramNames = [];
|
|
219
344
|
for (const p of (fn.params ?? [])) {
|
|
345
|
+
// Tolerant-parse placeholder: a `.` context parameter whose name is
|
|
346
|
+
// still being typed. The node IS the marker, and its bytes sit exactly
|
|
347
|
+
// where the editor maps the cursor — leaving them would put a dot in the
|
|
348
|
+
// generated TS and TypeScript would answer the `.`-triggered completion
|
|
349
|
+
// with the whole global scope. A parameter list has nothing to stand in
|
|
350
|
+
// for, so the marker lowers to nothing; `broken` is what makes the editor
|
|
351
|
+
// opt the character after it out of completion (see spansToMappings).
|
|
352
|
+
if (p.nolaError) {
|
|
353
|
+
this.s.overwrite(p.start, p.end, "", { broken: true });
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
220
356
|
if (p.nolaContextual)
|
|
221
357
|
this.s.remove(p.nolaContextual.start, p.nolaContextual.end);
|
|
222
358
|
const target = p.type === "AssignmentPattern" ? p.left : p;
|
|
223
359
|
if (target.type !== "Identifier")
|
|
224
|
-
continue; // patterns: parser already diagnosed
|
|
360
|
+
continue; // patterns: parser already diagnosed `.` misuse; nothing to harvest
|
|
225
361
|
const paramName = target.name;
|
|
226
362
|
if (!paramName)
|
|
227
363
|
continue;
|
|
@@ -249,31 +385,48 @@ export class Lowerer {
|
|
|
249
385
|
}
|
|
250
386
|
argEntries.push(invocationArgEntry(paramName, typeExpr, Boolean(p.nolaContextual)));
|
|
251
387
|
}
|
|
388
|
+
// The marker literal cannot stay between the name and `(`; its text lands
|
|
389
|
+
// in the wrapper closer. Prose is a JSON string as before; holes make it a
|
|
390
|
+
// template literal (lexical) or a prompt-template closure (`${.member}`),
|
|
391
|
+
// both copied byte-identically with anchors so the editor keeps completion,
|
|
392
|
+
// hover and precise TS errors inside the marker.
|
|
393
|
+
const inst = marker?.quasi !== undefined
|
|
394
|
+
? this.instructionFieldFor(marker.quasi, marker.hasScopeAccess === true, marker.instruction)
|
|
395
|
+
: { field: JSON.stringify(marker?.instruction ?? ""), copyText: "", anchors: [], holes: [] };
|
|
396
|
+
const close = invocationClose(name, inst.field, argEntries);
|
|
397
|
+
const copyAt = inst.copyText ? close.indexOf(inst.copyText) : -1;
|
|
398
|
+
const anchors = copyAt >= 0 ? inst.anchors.map((a) => ({ ...a, textOffset: a.textOffset + copyAt })) : undefined;
|
|
252
399
|
this.s.appendRight(body.start + 1, invocationOpen(paramNames));
|
|
253
|
-
this.s.appendLeft(body.end - 1,
|
|
400
|
+
this.s.appendLeft(body.end - 1, close, anchors ? { anchors } : {});
|
|
254
401
|
this.meta.nolaFunctions.push(name);
|
|
255
402
|
this.usedRuntime = true;
|
|
403
|
+
this.visitCopiedHoles(inst.holes, false);
|
|
256
404
|
}
|
|
257
405
|
lowerCallIntent(call, inNolaFnBody) {
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
406
|
+
const tagged = call.callee.type === "TaggedTemplateExpression" ? call.callee : undefined;
|
|
407
|
+
// The hint literal is removed with the `(` and re-emitted inside the args
|
|
408
|
+
// head — same copy-and-anchor treatment as the infer-function marker.
|
|
409
|
+
const inst = tagged
|
|
410
|
+
? this.instructionFieldFor(tagged.quasi, tagged.quasi.nolaHasScopeAccess === true, tagged.quasi.quasis.map((q) => q.value.cooked ?? q.value.raw).join(""))
|
|
411
|
+
: { field: '""', copyText: "", anchors: [], holes: [] };
|
|
266
412
|
for (const arg of call.arguments)
|
|
267
413
|
this.checkCallIntentArg(arg);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const
|
|
414
|
+
// In the tagged form the callee expression is the tag; either way its
|
|
415
|
+
// bytes stay verbatim in place as the `fn:` value, and the overwrite from
|
|
416
|
+
// its end to the first argument removes the marker (if any) and the `(`.
|
|
417
|
+
const callee = tagged ? tagged.tag : call.callee;
|
|
418
|
+
const calleeText = this.source.slice(callee.start, callee.end);
|
|
419
|
+
const simple = callee.type === "Identifier" || callee.type === "MemberExpression";
|
|
420
|
+
const typeText = simple ? callIntentTypeText(calleeText) : "";
|
|
272
421
|
this.s.appendLeft(call.start, callIntentOpen(typeText));
|
|
273
422
|
const argsStart = call.arguments.length > 0 ? call.arguments[0].start : call.end - 1;
|
|
274
|
-
|
|
423
|
+
const head = callIntentArgsHead(calleeText, inst.field, call.loc.start);
|
|
424
|
+
const copyAt = inst.copyText ? head.indexOf(inst.copyText) : -1;
|
|
425
|
+
const anchors = copyAt >= 0 ? inst.anchors.map((a) => ({ ...a, textOffset: a.textOffset + copyAt })) : undefined;
|
|
426
|
+
this.s.overwrite(callee.end, argsStart, head, anchors ? { anchors } : {});
|
|
275
427
|
this.s.overwrite(call.end - 1, call.end, CALL_INTENT_CLOSE);
|
|
276
428
|
this.usedRuntime = true;
|
|
429
|
+
this.visitCopiedHoles(inst.holes, inNolaFnBody);
|
|
277
430
|
for (const arg of call.arguments)
|
|
278
431
|
this.visit(arg, inNolaFnBody, false);
|
|
279
432
|
}
|
|
@@ -326,15 +479,23 @@ export class Lowerer {
|
|
|
326
479
|
// original bytes; each ${expr} gets __nola.fmt(...) wrapped around it.
|
|
327
480
|
// An authored <T> is copied into the prefix byte-identically — anchor it
|
|
328
481
|
// so navigation/hover/completion work on the type text at the ask site.
|
|
329
|
-
|
|
482
|
+
// A `${.member}` literal is a prompt template: instruction keeps the raw
|
|
483
|
+
// text (holes verbatim) and the literal itself becomes the body of the
|
|
484
|
+
// template closure, in place — its bytes stay verbatim, only the scope
|
|
485
|
+
// parameter is inserted before each scope dot (see the NolaScopeAccess
|
|
486
|
+
// visit). Lexical holes inside a template are not fmt-wrapped: tpl formats.
|
|
487
|
+
const isTemplate = quasi.nolaHasScopeAccess === true;
|
|
488
|
+
const open = isTemplate ? extractOpenTemplate(typeText, rawTemplateText(this.source, quasi)) : extractOpen(typeText);
|
|
330
489
|
const typeNode = node.typeArgs?.params[0];
|
|
331
490
|
const anchors = typeNode
|
|
332
491
|
? [{ sourceStart: typeNode.start, sourceEnd: typeNode.end, textOffset: open.indexOf(typeText) + 1 }]
|
|
333
492
|
: undefined;
|
|
334
|
-
this.s.overwrite(node.start, quasi.start, open, anchors);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
493
|
+
this.s.overwrite(node.start, quasi.start, open, { anchors });
|
|
494
|
+
if (!isTemplate) {
|
|
495
|
+
for (const expr of quasi.expressions) {
|
|
496
|
+
this.s.appendLeft(expr.start, FMT_OPEN);
|
|
497
|
+
this.s.appendLeft(expr.end, FMT_CLOSE);
|
|
498
|
+
}
|
|
338
499
|
}
|
|
339
500
|
const suffix = extractClose(typeExpr, node.loc.start);
|
|
340
501
|
if (node.end > quasi.end) {
|
|
@@ -346,8 +507,15 @@ export class Lowerer {
|
|
|
346
507
|
this.s.appendLeft(node.end, suffix);
|
|
347
508
|
}
|
|
348
509
|
this.usedRuntime = true;
|
|
349
|
-
|
|
350
|
-
|
|
510
|
+
const prevSite = this.scopeSite;
|
|
511
|
+
this.scopeSite = isTemplate ? "inplace" : "none";
|
|
512
|
+
try {
|
|
513
|
+
for (const expr of quasi.expressions)
|
|
514
|
+
this.visit(expr, inNolaFnBody, false);
|
|
515
|
+
}
|
|
516
|
+
finally {
|
|
517
|
+
this.scopeSite = prevSite;
|
|
518
|
+
}
|
|
351
519
|
}
|
|
352
520
|
}
|
|
353
521
|
//# sourceMappingURL=lowerer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lowerer.js","sourceRoot":"","sources":["../../src/lower/lowerer.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EACL,QAAQ,EAWR,IAAI,GACL,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAEL,iBAAiB,EAEjB,kBAAkB,EAElB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAmB,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,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AC5B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Position } from "@nola-lang/ast";
|
|
2
2
|
import { type CompanionImport } from "../schema-expr.js";
|
|
3
|
+
import type { EditAnchor } from "../spans.js";
|
|
3
4
|
/**
|
|
4
5
|
* Every piece of TS text the lowering emits lives here; the Lowerer decides
|
|
5
6
|
* WHERE each piece lands (span mechanics), this module decides WHAT it says.
|
|
@@ -34,19 +35,47 @@ export declare const askClose: (providerName?: string) => string;
|
|
|
34
35
|
/**
|
|
35
36
|
* The wrapper opener. The `void` read of every named param forces the
|
|
36
37
|
* executor closure to capture them: V8 drops variables an arrow never
|
|
37
|
-
* references, so a
|
|
38
|
+
* references, so a `.user` the body does not mention would otherwise be
|
|
38
39
|
* unavailable to the debugger's evaluate — hover over the param showed
|
|
39
40
|
* nothing. One statement per param (a comma expression is TS2695 under
|
|
40
41
|
* strict); they ride the unmapped wrapper line, so stepping never sees them.
|
|
41
42
|
*/
|
|
42
43
|
export declare const invocationOpen: (paramNames: string[]) => string;
|
|
43
|
-
/** One FunctionScopeInit args entry; only contextual (
|
|
44
|
+
/** One FunctionScopeInit args entry; only contextual (`.`) params carry the live value. */
|
|
44
45
|
export declare const invocationArgEntry: (name: string, typeExpr: string | undefined, contextual: boolean) => string;
|
|
45
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The wrapper closer. `instructionField` is the full JS text after
|
|
48
|
+
* `instruction: ` — a JSON string for prose, a template literal for a marker
|
|
49
|
+
* with lexical holes, or `"<raw>", template: (__nola_s) => __nola.tpl\`…\`` for
|
|
50
|
+
* a prompt template (see templateCopy).
|
|
51
|
+
*/
|
|
52
|
+
export declare const invocationClose: (fnName: string, instructionField: string, argEntries: string[]) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Copies a template literal's bytes for re-emission elsewhere (marker / call
|
|
55
|
+
* hint — their bytes cannot stay where they are). Scope mode inserts
|
|
56
|
+
* SCOPE_PARAM before every `${.member}` node; fmt mode wraps every hole
|
|
57
|
+
* expression in __nola.fmt(...). Anchors cover the verbatim runs (textOffset
|
|
58
|
+
* relative to the returned text) so editor features survive the move.
|
|
59
|
+
*/
|
|
60
|
+
export declare function templateCopy(source: string, quasi: {
|
|
61
|
+
start: number;
|
|
62
|
+
end: number;
|
|
63
|
+
expressions: Array<{
|
|
64
|
+
start: number;
|
|
65
|
+
end: number;
|
|
66
|
+
}>;
|
|
67
|
+
}, scopeNodes: Array<{
|
|
68
|
+
start: number;
|
|
69
|
+
end: number;
|
|
70
|
+
}>, mode: "scope" | "fmt"): {
|
|
71
|
+
text: string;
|
|
72
|
+
anchors: EditAnchor[];
|
|
73
|
+
};
|
|
46
74
|
/** Result type argument recovered from the tagged callee (simple tags only). */
|
|
47
75
|
export declare const callIntentTypeText: (tagText: string) => string;
|
|
48
76
|
export declare const callIntentOpen: (typeText: string) => string;
|
|
49
|
-
|
|
77
|
+
/** `instructionField` is the full JS text after `instruction: ` (see invocationClose). */
|
|
78
|
+
export declare const callIntentArgsHead: (tagText: string, instructionField: string, loc: Position) => string;
|
|
50
79
|
export declare const CALL_INTENT_CLOSE = "] })";
|
|
51
80
|
/** An untyped extractor resolves as a string. */
|
|
52
81
|
export declare const EXTRACT_DEFAULT_TYPE_EXPR = "__nola.types.string()";
|
|
@@ -54,8 +83,33 @@ export declare const EXTRACT_DEFAULT_TYPE_TEXT = "<any>";
|
|
|
54
83
|
/** The extractor's `<T>` echoed as written in the source. */
|
|
55
84
|
export declare const typeArgsText: (sourceText: string) => string;
|
|
56
85
|
export declare const extractOpen: (typeText: string) => string;
|
|
86
|
+
/** Reserved parameter name of a lowered prompt-template closure. */
|
|
87
|
+
export declare const SCOPE_PARAM = "__nola_s";
|
|
88
|
+
/** `template:` field text up to (not including) the copied / in-place literal. */
|
|
89
|
+
export declare const TEMPLATE_OPEN = "template: (__nola_s) => __nola.tpl";
|
|
90
|
+
/** The literal's inner text, holes verbatim — the string form of a template's instruction. */
|
|
91
|
+
export declare const rawTemplateText: (source: string, quasi: {
|
|
92
|
+
start: number;
|
|
93
|
+
end: number;
|
|
94
|
+
}) => string;
|
|
95
|
+
/**
|
|
96
|
+
* Extractor opener for a `${.member}` template literal: the raw text as the
|
|
97
|
+
* instruction string, then the closure whose body is the in-place literal.
|
|
98
|
+
*/
|
|
99
|
+
export declare const extractOpenTemplate: (typeText: string, rawInstruction: string) => string;
|
|
57
100
|
/** Wraps each `${expr}` substitution in the extractor template. */
|
|
58
101
|
export declare const FMT_OPEN = "__nola.fmt(";
|
|
59
102
|
export declare const FMT_CLOSE = ")";
|
|
60
103
|
export declare const extractClose: (typeExpr: string, loc: Position) => string;
|
|
104
|
+
/**
|
|
105
|
+
* Stand-in for a construct the parser could only recover as a placeholder —
|
|
106
|
+
* a `..` whose prompt is still being typed, or the reserved `(..)` form. It
|
|
107
|
+
* exists for the EDITOR only (strict mode throws on these, so no build ever
|
|
108
|
+
* emits it) and has two jobs: keep the generated text parseable, and end in a
|
|
109
|
+
* character that is not a dot. TypeScript only answers a `.`-triggered
|
|
110
|
+
* completion when a dot precedes the position, so the half-typed marker stops
|
|
111
|
+
* pulling the whole global scope into the suggestion list. `never` is
|
|
112
|
+
* assignable everywhere, so the placeholder adds no type errors of its own.
|
|
113
|
+
*/
|
|
114
|
+
export declare const BROKEN_CONSTRUCT = "(undefined as never)";
|
|
61
115
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/lower/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/lower/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C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ED
|
@@ -12,10 +12,10 @@ import { accessorNameFor } from "../schema-expr.js";
|
|
|
12
12
|
* (`const eager = go();`) reads it before the declaration runs and hits the TDZ.
|
|
13
13
|
* It holds no state: `__nola.context.file` is memoized by path in the runtime.
|
|
14
14
|
*/
|
|
15
|
-
export const runtimeImport = (displayFile) => `
|
|
16
|
-
import { __nola } from "@nola-lang/runtime";
|
|
17
|
-
__nola.useRuntime(${NOLA_EMIT});
|
|
18
|
-
function __nola_file_ctx() { return __nola.context.file(${JSON.stringify(displayFile)}); }
|
|
15
|
+
export const runtimeImport = (displayFile) => `
|
|
16
|
+
import { __nola } from "@nola-lang/runtime";
|
|
17
|
+
__nola.useRuntime(${NOLA_EMIT});
|
|
18
|
+
function __nola_file_ctx() { return __nola.context.file(${JSON.stringify(displayFile)}); }
|
|
19
19
|
`;
|
|
20
20
|
/**
|
|
21
21
|
* Appendix accessor for a named type. A `function` declaration for the same TDZ
|
|
@@ -39,22 +39,56 @@ export const askClose = (providerName) => `, __frame${providerName ? `, ${JSON.s
|
|
|
39
39
|
/**
|
|
40
40
|
* The wrapper opener. The `void` read of every named param forces the
|
|
41
41
|
* executor closure to capture them: V8 drops variables an arrow never
|
|
42
|
-
* references, so a
|
|
42
|
+
* references, so a `.user` the body does not mention would otherwise be
|
|
43
43
|
* unavailable to the debugger's evaluate — hover over the param showed
|
|
44
44
|
* nothing. One statement per param (a comma expression is TS2695 under
|
|
45
45
|
* strict); they ride the unmapped wrapper line, so stepping never sees them.
|
|
46
46
|
*/
|
|
47
47
|
export const invocationOpen = (paramNames) => `\n return __nola.intents.Intent(async (__frame) => {${paramNames.map((n) => ` void ${n};`).join("")}`;
|
|
48
|
-
/** One FunctionScopeInit args entry; only contextual (
|
|
48
|
+
/** One FunctionScopeInit args entry; only contextual (`.`) params carry the live value. */
|
|
49
49
|
export const invocationArgEntry = (name, typeExpr, contextual) => `{ name: ${JSON.stringify(name)}${typeExpr ? `, type: ${typeExpr}` : ""}${contextual ? `, contextual: true, value: ${name}` : ""} }`;
|
|
50
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The wrapper closer. `instructionField` is the full JS text after
|
|
52
|
+
* `instruction: ` — a JSON string for prose, a template literal for a marker
|
|
53
|
+
* with lexical holes, or `"<raw>", template: (__nola_s) => __nola.tpl\`…\`` for
|
|
54
|
+
* a prompt template (see templateCopy).
|
|
55
|
+
*/
|
|
56
|
+
export const invocationClose = (fnName, instructionField, argEntries) => {
|
|
51
57
|
const argsField = argEntries.length > 0 ? `, args: [${argEntries.join(", ")}]` : "";
|
|
52
|
-
return ` }, __nola_file_ctx().func({ fn: ${JSON.stringify(fnName)}, instruction: ${
|
|
58
|
+
return ` }, __nola_file_ctx().func({ fn: ${JSON.stringify(fnName)}, instruction: ${instructionField}${argsField} }));\n`;
|
|
53
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Copies a template literal's bytes for re-emission elsewhere (marker / call
|
|
62
|
+
* hint — their bytes cannot stay where they are). Scope mode inserts
|
|
63
|
+
* SCOPE_PARAM before every `${.member}` node; fmt mode wraps every hole
|
|
64
|
+
* expression in __nola.fmt(...). Anchors cover the verbatim runs (textOffset
|
|
65
|
+
* relative to the returned text) so editor features survive the move.
|
|
66
|
+
*/
|
|
67
|
+
export function templateCopy(source, quasi, scopeNodes, mode) {
|
|
68
|
+
const inserts = mode === "scope"
|
|
69
|
+
? scopeNodes.map((n) => [n.start, SCOPE_PARAM])
|
|
70
|
+
: quasi.expressions.flatMap((e) => [[e.start, FMT_OPEN], [e.end, FMT_CLOSE]]);
|
|
71
|
+
inserts.sort((a, b) => a[0] - b[0]);
|
|
72
|
+
let text = "";
|
|
73
|
+
const anchors = [];
|
|
74
|
+
let cursor = quasi.start;
|
|
75
|
+
for (const [pos, ins] of inserts) {
|
|
76
|
+
if (pos > cursor) {
|
|
77
|
+
anchors.push({ sourceStart: cursor, sourceEnd: pos, textOffset: text.length });
|
|
78
|
+
text += source.slice(cursor, pos);
|
|
79
|
+
}
|
|
80
|
+
text += ins;
|
|
81
|
+
cursor = pos;
|
|
82
|
+
}
|
|
83
|
+
anchors.push({ sourceStart: cursor, sourceEnd: quasi.end, textOffset: text.length });
|
|
84
|
+
text += source.slice(cursor, quasi.end);
|
|
85
|
+
return { text, anchors };
|
|
86
|
+
}
|
|
54
87
|
/** Result type argument recovered from the tagged callee (simple tags only). */
|
|
55
88
|
export const callIntentTypeText = (tagText) => `<Awaited<ReturnType<typeof ${tagText}>>>`;
|
|
56
89
|
export const callIntentOpen = (typeText) => `__nola.intents.FunctionCallingIntent${typeText}({ fn: `;
|
|
57
|
-
|
|
90
|
+
/** `instructionField` is the full JS text after `instruction: ` (see invocationClose). */
|
|
91
|
+
export const callIntentArgsHead = (tagText, instructionField, loc) => `, name: ${JSON.stringify(tagText)}, instruction: ${instructionField}, ` +
|
|
58
92
|
`loc: ${JSON.stringify(locText(loc))}, args: [`;
|
|
59
93
|
export const CALL_INTENT_CLOSE = "] })";
|
|
60
94
|
/** An untyped extractor resolves as a string. */
|
|
@@ -63,8 +97,30 @@ export const EXTRACT_DEFAULT_TYPE_TEXT = "<any>";
|
|
|
63
97
|
/** The extractor's `<T>` echoed as written in the source. */
|
|
64
98
|
export const typeArgsText = (sourceText) => `<${sourceText}>`;
|
|
65
99
|
export const extractOpen = (typeText) => `__nola.intents.ExtractIntent${typeText}({ instruction: `;
|
|
100
|
+
/** Reserved parameter name of a lowered prompt-template closure. */
|
|
101
|
+
export const SCOPE_PARAM = "__nola_s";
|
|
102
|
+
/** `template:` field text up to (not including) the copied / in-place literal. */
|
|
103
|
+
export const TEMPLATE_OPEN = `template: (${SCOPE_PARAM}) => __nola.tpl`;
|
|
104
|
+
/** The literal's inner text, holes verbatim — the string form of a template's instruction. */
|
|
105
|
+
export const rawTemplateText = (source, quasi) => source.slice(quasi.start + 1, quasi.end - 1);
|
|
106
|
+
/**
|
|
107
|
+
* Extractor opener for a `${.member}` template literal: the raw text as the
|
|
108
|
+
* instruction string, then the closure whose body is the in-place literal.
|
|
109
|
+
*/
|
|
110
|
+
export const extractOpenTemplate = (typeText, rawInstruction) => `__nola.intents.ExtractIntent${typeText}({ instruction: ${JSON.stringify(rawInstruction)}, ${TEMPLATE_OPEN}`;
|
|
66
111
|
/** Wraps each `${expr}` substitution in the extractor template. */
|
|
67
112
|
export const FMT_OPEN = "__nola.fmt(";
|
|
68
113
|
export const FMT_CLOSE = ")";
|
|
69
114
|
export const extractClose = (typeExpr, loc) => `, type: ${typeExpr}, loc: ${JSON.stringify(locText(loc))} })`;
|
|
115
|
+
/**
|
|
116
|
+
* Stand-in for a construct the parser could only recover as a placeholder —
|
|
117
|
+
* a `..` whose prompt is still being typed, or the reserved `(..)` form. It
|
|
118
|
+
* exists for the EDITOR only (strict mode throws on these, so no build ever
|
|
119
|
+
* emits it) and has two jobs: keep the generated text parseable, and end in a
|
|
120
|
+
* character that is not a dot. TypeScript only answers a `.`-triggered
|
|
121
|
+
* completion when a dot precedes the position, so the half-typed marker stops
|
|
122
|
+
* pulling the whole global scope into the suggestion list. `never` is
|
|
123
|
+
* assignable everywhere, so the placeholder adds no type errors of its own.
|
|
124
|
+
*/
|
|
125
|
+
export const BROKEN_CONSTRUCT = "(undefined as never)";
|
|
70
126
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/lower/templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAwB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/lower/templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAA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