$ can be in an identifier now

This commit is contained in:
Chris Wanstrath 2025-12-10 13:57:13 -08:00
parent 69b2297280
commit 491e37a7f8
2 changed files with 2 additions and 2 deletions

View File

@ -258,7 +258,7 @@ describe('curly strings', () => {
test('interpolation edge cases', () => {
expect(`{[a=1 b=2 c={wild}]}`).toEvaluateTo(`[a=1 b=2 c={wild}]`)
expect(`a = 1;b = 2;c = 3;{$a $b $c}`).toEvaluateTo(`1 2 3`)
expect(`a = 1;b = 2;c = 3;{$a$b$c}`).toEvaluateTo(`123`)
expect(`a = 1;b = 2;c = 3;{$(a)$(b)$(c)}`).toEvaluateTo(`123`)
})
})

View File

@ -38,7 +38,7 @@ export const tokenizeCurlyString = (value: string): (string | [string, SyntaxNod
const input = value.slice(start + 2, pos) // skip '$('
tokens.push([input, parse(input)])
start = ++pos // skip ')'
start = pos + 1 // start after ')'
} else {
char = value[++pos]
if (!char) break