Skip to content

Fix Unicode handling in the math expression for identifiers and infinity - #4560

Merged
Keavon merged 1 commit into
masterfrom
math-parser-unicode-identifiers
Sep 21, 2026
Merged

Keavon merged 1 commit into
masterfrom
math-parser-unicode-identifiers

Conversation

@Keavon

@Keavon Keavon commented Sep 21, 2026

Copy link
Copy Markdown
Member

Identifiers (variable bindings) are now treated the same way as the Rust spec, except no initial underscore and no middle dot looking characters which could be confused for a multiplication dot symbol. Also now prints the infinity symbol ∞ in the UI and node input/output string handling.

Partly closes #2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread libraries/math-parser/src/lexer.rs
Names follow the `XID_Start XID_Continue*` rule of UAX #31, the same
one Rust spells, so letters from every script name a variable and
combining marks extend a name: a decomposed `é` is one name rather
than the constant `e` beside a stray mark. Digits of any script, lone
marks, invisible formatting characters like the right-to-left
override, and symbols including emoji can no longer begin a name,
which also leaves `#`, `$`, `~`, and `@` free to become namespace
prefixes once a host scope needs them. Rust's special case admitting a
leading underscore is deliberately not adopted.

Reads the character classes from unicode-ident, the table crate the
proc-macro stack already builds with, rather than hand-rolling the
ranges.
@Keavon
Keavon force-pushed the math-parser-unicode-identifiers branch from 176fdd3 to ae336fc Compare September 21, 2026 05:44
@Keavon
Keavon merged commit 9a925d1 into master Sep 21, 2026
11 checks passed
@Keavon
Keavon deleted the math-parser-unicode-identifiers branch September 21, 2026 06:04

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) ae336fc2 Deployed Sep 21, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue: Math expression parser/calculator

1 participant