Repository navigation
Raise unknown named character errors with the sntufn tag - #181
Merged
Merged
Conversation
parse_escape_sequence raised NamedCharacterSyntaxError("Syntax", "sntufn", ...),
but SyntaxError takes the message tag as its first argument (the name is
always "Syntax"). The message then came out as
"Syntax::Syntax: Message Syntax::Syntax not found" instead of
"Syntax::sntufn: Unknown unicode longname ...".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks for noticing and fixing this somewhat obvious bug. |
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.
parse_escape_sequenceraisedNamedCharacterSyntaxError("Syntax", "sntufn", ...)in two places.SyntaxError.__init__takes the message tag as its first argument (the message name is always"Syntax"), so the tag became"Syntax"and"sntufn"was passed as a message argument. In Mathics3 this shows up as:instead of
The other raise site, in
parse_named_character, already uses("sntufn", name, ...).This PR passes
"sntufn"as the tag and the unknown name as the first argument, which is what thesntufntemplate (Unknown unicode longname1(line4of5).) expects. Inputs that hit these two paths:\[Alpha\],\[\Sigma],\[Theta(no closing bracket).Tests:
test_invalid_named_character_messageintest/test_escape_sequences.pychecks the tag and the first argument.🤖 Generated with Claude Code