Compare commits

..

1 Commits

Author SHA1 Message Date
ca95427d29 allow more unicode in variable names 2025-10-26 13:02:05 -07:00

View File

@ -32,6 +32,8 @@ describe('Identifier', () => {
}) })
test('parses mathematical unicode symbols like 𝜋 as identifiers', () => { test('parses mathematical unicode symbols like 𝜋 as identifiers', () => {
// FAILING TEST: Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
// are not yet recognized as valid identifier characters
expect('𝜋').toMatchTree(` expect('𝜋').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier 𝜋`) Identifier 𝜋`)
@ -110,24 +112,28 @@ describe('Unicode Symbol Support', () => {
describe('Greek Letters (not currently supported)', () => { describe('Greek Letters (not currently supported)', () => {
test('Greek lowercase alpha α (U+03B1)', () => { test('Greek lowercase alpha α (U+03B1)', () => {
// FAILING: Greek letters not in supported ranges
expect('α').toMatchTree(` expect('α').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier α`) Identifier α`)
}) })
test('Greek lowercase beta β (U+03B2)', () => { test('Greek lowercase beta β (U+03B2)', () => {
// FAILING: Greek letters not in supported ranges
expect('β').toMatchTree(` expect('β').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier β`) Identifier β`)
}) })
test('Greek lowercase lambda λ (U+03BB)', () => { test('Greek lowercase lambda λ (U+03BB)', () => {
// FAILING: Greek letters not in supported ranges
expect('λ').toMatchTree(` expect('λ').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier λ`) Identifier λ`)
}) })
test('Greek lowercase pi π (U+03C0)', () => { test('Greek lowercase pi π (U+03C0)', () => {
// FAILING: Greek letters not in supported ranges
// Note: This is different from mathematical pi 𝜋 // Note: This is different from mathematical pi 𝜋
expect('π').toMatchTree(` expect('π').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
@ -137,18 +143,21 @@ describe('Unicode Symbol Support', () => {
describe('Mathematical Alphanumeric Symbols (not currently supported)', () => { describe('Mathematical Alphanumeric Symbols (not currently supported)', () => {
test('Mathematical italic small pi 𝜋 (U+1D70B)', () => { test('Mathematical italic small pi 𝜋 (U+1D70B)', () => {
// FAILING: Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
expect('𝜋').toMatchTree(` expect('𝜋').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier 𝜋`) Identifier 𝜋`)
}) })
test('Mathematical bold small x 𝐱 (U+1D431)', () => { test('Mathematical bold small x 𝐱 (U+1D431)', () => {
// FAILING: Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
expect('𝐱').toMatchTree(` expect('𝐱').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier 𝐱`) Identifier 𝐱`)
}) })
test('Mathematical script capital F 𝓕 (U+1D4D5)', () => { test('Mathematical script capital F 𝓕 (U+1D4D5)', () => {
// FAILING: Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
expect('𝓕').toMatchTree(` expect('𝓕').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier 𝓕`) Identifier 𝓕`)
@ -157,18 +166,21 @@ describe('Unicode Symbol Support', () => {
describe('Mathematical Operators (not currently supported)', () => { describe('Mathematical Operators (not currently supported)', () => {
test('Infinity symbol ∞ (U+221E)', () => { test('Infinity symbol ∞ (U+221E)', () => {
// FAILING: Mathematical Operators (U+2200-U+22FF)
expect('∞').toMatchTree(` expect('∞').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('Sum symbol ∑ (U+2211)', () => { test('Sum symbol ∑ (U+2211)', () => {
// FAILING: Mathematical Operators (U+2200-U+22FF)
expect('∑').toMatchTree(` expect('∑').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('Integral symbol ∫ (U+222B)', () => { test('Integral symbol ∫ (U+222B)', () => {
// FAILING: Mathematical Operators (U+2200-U+22FF)
expect('∫').toMatchTree(` expect('∫').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
@ -177,12 +189,14 @@ describe('Unicode Symbol Support', () => {
describe('Superscripts and Subscripts (not currently supported)', () => { describe('Superscripts and Subscripts (not currently supported)', () => {
test('Superscript two ² (U+00B2)', () => { test('Superscript two ² (U+00B2)', () => {
// FAILING: Superscripts and Subscripts (U+2070-U+209F)
expect('x²').toMatchTree(` expect('x²').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier x²`) Identifier x²`)
}) })
test('Subscript two ₂ (U+2082)', () => { test('Subscript two ₂ (U+2082)', () => {
// FAILING: Superscripts and Subscripts (U+2070-U+209F)
expect('h₂o').toMatchTree(` expect('h₂o').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier ho`) Identifier ho`)
@ -191,18 +205,21 @@ describe('Unicode Symbol Support', () => {
describe('Arrows (not currently supported)', () => { describe('Arrows (not currently supported)', () => {
test('Rightward arrow → (U+2192)', () => { test('Rightward arrow → (U+2192)', () => {
// FAILING: Arrows (U+2190-U+21FF)
expect('→').toMatchTree(` expect('→').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('Leftward arrow ← (U+2190)', () => { test('Leftward arrow ← (U+2190)', () => {
// FAILING: Arrows (U+2190-U+21FF)
expect('←').toMatchTree(` expect('←').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('Double rightward arrow ⇒ (U+21D2)', () => { test('Double rightward arrow ⇒ (U+21D2)', () => {
// FAILING: Arrows (U+2190-U+21FF)
expect('⇒').toMatchTree(` expect('⇒').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
@ -211,18 +228,21 @@ describe('Unicode Symbol Support', () => {
describe('CJK Symbols (not currently supported)', () => { describe('CJK Symbols (not currently supported)', () => {
test('Hiragana あ (U+3042)', () => { test('Hiragana あ (U+3042)', () => {
// FAILING: Hiragana (U+3040-U+309F)
expect('あ').toMatchTree(` expect('あ').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('Katakana カ (U+30AB)', () => { test('Katakana カ (U+30AB)', () => {
// FAILING: Katakana (U+30A0-U+30FF)
expect('カ').toMatchTree(` expect('カ').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)
}) })
test('CJK Unified Ideograph 中 (U+4E2D)', () => { test('CJK Unified Ideograph 中 (U+4E2D)', () => {
// FAILING: CJK Unified Ideographs (U+4E00-U+9FFF)
expect('中').toMatchTree(` expect('中').toMatchTree(`
FunctionCallOrIdentifier FunctionCallOrIdentifier
Identifier `) Identifier `)