Repository navigation
Let a subscript have a subscript - #2070
Merged
Merged
Conversation
A name took at most one underscore, so X_a_beta, which technical papers
write for X with the subscript a_beta, was a lexer error. A subscript may
now have one of its own: X_a_beta is one variable, and its LaTeX is
X_{a_{\beta}}, each level set as a name is, Greek letters and constants
included. An underscore still neither begins nor ends a name, and two do
not stand together: x__1 is still an error.
Fixes #524.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…e-a-subscript # Conflicts: # Sources/AngouriMath/Core/Antlr/AngouriMathLexer.cs # Sources/AngouriMath/Core/Antlr/AngouriMathLexer.interp
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 #524.
_, soX_a_betawas a lexer error, where technical papers write it forXwith the subscripta_beta. On 2.6.0, evenMathS.Var("X_a_beta")throws.X_a_betais one variable, and its LaTeX isX_{a_{\beta}}. Each level is set as a name is, so Greek letters and constants are included:x_1_2_eisx_{1_{2_{\mathrm{e}}}}._still neither begins nor ends a name, and two do not stand together, sox__1is still an error.x_1_2, and says what nesting gives.Tests:
SyntaxDocumentedTestreadsx_1_2andX_a_betaas names andx__1as an error.LatexTestcovers two levels, three levels, and a parsed sum.Results:
#2068 also regenerates the parser, so whichever of the two merges second is regenerated from the merged grammar.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura