Repository navigation
Say what a string parses to when it is not the entity asked for - #2574
Merged
Rafael-SOWNet merged 3 commits intoNov 27, 2026
Merged
Conversation
Entity.Variable v0 = "v0" threw CannotParseInstanceException saying only that no variable could be parsed from v0. It parses as v ^ 0, because a digit written against a name is its power (#1503), so a physics formula with v0 in it loses the v0 without an error. The message now says what the string parsed to, and for a name with a digit against it, that the variable with that index is spelled v_0. Every implicit conversion from a string goes through the same FromString, so Matrix and Set say what they parsed to as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing-says-what-it-parsed-to
…ing-says-what-it-parsed-to
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2574 +/- ##
==========================================
+ Coverage 86.71% 86.72% +0.01%
==========================================
Files 344 344
Lines 74884 74889 +5
Branches 21856 21857 +1
==========================================
+ Hits 64937 64950 +13
+ Misses 5374 5365 -9
- Partials 4573 4574 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
variable-from-a-string-says-what-it-parsed-to
branch
November 27, 2026 01:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2567.
Entity.Variable v0 = "v0"threwCannotParseInstanceExceptionsaying only that no variable could be parsed fromv0.v0parses asv ^ 0, because a digit written against a name is its power (#1503, on 3.0), so a physics formula withv0in it loses thev0without an error. Changing that reading is #1503's job; this PR changes only what the message says.The message now says what the string parsed to. For a name with a digit against it, it also says that the variable with that index is spelled
v_0. Every implicit conversion from a string goes through the sameFromString, soMatrix,Setand the rest say what they parsed to as well.Entity.Variable v = ..."v0"Cannot parse an instance of Variable from `v0`Cannot parse an instance of Variable from `v0`: it parses as `v ^ 0`: a digit written against a name is its power, and `v_0` is the variable with that index"alpha1"... from `alpha1`...: it parses as `alpha ^ 1`: ..., and `alpha_1` is the variable with that index"x + 1"... from `x + 1`...: it parses as `x + 1`"x^2"... from `x^2`...: it parses as `x ^ 2`Complex.ParseandBooleankeep their own message, whichCircleTestpins.Local checks:
AngouriMathPublishAot=true;🤖 Generated with Claude Code