Skip to content

Commit f5aa2aa

Browse files
Dale-Blackclaude
andcommitted
Fix playground string interpolation (re-apply lost fix from 5c89280)
The docs/src/playground/lowerer.js was overwritten when docs were rebuilt, losing the StringLit/Identifier node kind matching fix. The src/playground/ copy had the fix but docs/src/playground/ did not. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2e475d1 commit f5aa2aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/src/playground/lowerer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,14 +850,14 @@ function lowerStringInterp(node, ctx, mod) {
850850
var args = [];
851851
for (var i = 0; i < node.parts.length; i++) {
852852
var part = node.parts[i];
853-
if (part.kind === 'literal') {
853+
if (part.kind === 'literal' || part.kind === 'StringLit') {
854854
args.push(ctx.emit({ kind: STMT_LITERAL, typeId: TYPE_STRING, value: part.value }));
855-
} else if (part.kind === 'name') {
856-
var ref = ctx.lookup(part.value);
855+
} else if (part.kind === 'name' || part.kind === 'Identifier') {
856+
var ref = ctx.lookup(part.name || part.value);
857857
if (ref) {
858858
args.push(ref);
859859
} else {
860-
args.push(ctx.emit({ kind: STMT_CALL, callee: '$global', args: [], _name: part.value }));
860+
args.push(ctx.emit({ kind: STMT_CALL, callee: '$global', args: [], _name: part.name || part.value }));
861861
}
862862
} else if (part.kind === 'expr') {
863863
// Expression interpolation $(expr) — tokens need re-parsing

0 commit comments

Comments
 (0)