Skip to content

Add math parser support for shadowing builtin identifiers and introduce \ as a prefix to reach the builtins - #4562

Merged
Keavon merged 1 commit into
masterfrom
math-parser-constant-shadowing
Sep 21, 2026
Merged

Keavon merged 1 commit into
masterfrom
math-parser-constant-shadowing

Conversation

@Keavon

@Keavon Keavon commented Sep 21, 2026

Copy link
Copy Markdown
Member

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 4 files

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

Re-trigger cubic

Comment thread libraries/math-parser/src/lib.rs Outdated
Comment thread libraries/math-parser/src/lexer.rs Outdated
Comment thread libraries/math-parser/src/lexer.rs Outdated
…fix reaching the builtin

Constants resolve at evaluation time, after the environment, so a
binding of any spelling, word or typeset symbol, shadows the builtin of
exactly that spelling, and a host-supplied function likewise shadows a
builtin function. The `\` prefix, in LaTeX's habit, names the language's
own constant or function regardless of bindings (`\pi`, `\e`, `\sin`),
and is an error when no builtin has that name.
@Keavon
Keavon force-pushed the math-parser-constant-shadowing branch from 5b67016 to 7a11989 Compare September 21, 2026 07:17
@Keavon
Keavon merged commit 849e088 into master Sep 21, 2026
10 checks passed
@Keavon
Keavon deleted the math-parser-constant-shadowing branch September 21, 2026 07:46
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