Repository navigation
TeX reader: don't reparse a script after an error inside it - #310
Merged
Merged
Conversation
scripted was wrapped in try, so an error inside a script argument made it backtrack, expr returned the base alone, and bareSubSup then parsed the same script again, at every level: with an error at the innermost level, nested scripts still took time exponential in the depth (16 levels took 1s, the 29 of the new test didn't finish in 10 minutes), although 0495533 made the valid case linear. Once a script has started, an error in it is now an error.
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.
After 0495533, nested scripts parse in linear time, but not when there is an error inside them:
scriptedis wrapped intry, so an error in a script argument makes it backtrack, andbareSubSupthen parses the same script again, at every level. So the input ofnested_scripts_performance.testwith a\right)at the innermost level doesn't finish (16 levels already take a second). This removes thetry, so an error inside a script is just an error; I checked ~20,000 mutated inputs and the results (parse or error, and the output) are the same as before. Added that input as a test.