\pgfmathparse sandbox testing patches#1
Merged
xworld21 merged 6 commits intoxworld21:pgfmathparsefrom Dec 16, 2025
Merged
Conversation
Author
|
Feel free to look over this and merge it in @xworld21 . I will continue testing tonight and make a separate PR if needed - I hope the Fatals go back to the previous levels with all of these in. And since I ran the linter, good to remember the whitespace neutral diff |
xworld21
reviewed
Dec 16, 2025
| my $string = (ref $tokens ? UnTeX(Expand($tokens)->stripBraces) : $tokens); | ||
| my $string = (ref $tokens ? UnTeX(Expand($tokens)->stripBraces, 1) : $tokens); | ||
| # Normalize spaces and remove braces | ||
| $string =~ s/[}{]/ /g; |
Owner
There was a problem hiding this comment.
This is probably incorrect, because curly braces have a meaning in PGF. We'll have to come back to this later.
xworld21
approved these changes
Dec 16, 2025
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.
It turns out there were two minor buglets during sandbox testing for brucemiller#2485:
registerrule.UnTeXcalls can add a%\nseparator on long values, which breaks the grammar. Adding the flag to suppress those.skip:rule is a prefix-only rule in RecDescent. So I swapped them with spaces outside of the grammar, right before space normalization.sqrtwith a negative argument leading to a Fatal, so I guarded that with an Error instead.$aand$bunless they are declaredlocal. Which is a good tip, they often surve a special purpose in anonymous subs.To bookkeep some of the test articles: arXiv:1604.01057, arXiv:1405.5236