diff --git a/src/Text/TeXMath/Readers/TeX.hs b/src/Text/TeXMath/Readers/TeX.hs index de091ee1..5c5ddb62 100644 --- a/src/Text/TeXMath/Readers/TeX.hs +++ b/src/Text/TeXMath/Readers/TeX.hs @@ -672,7 +672,7 @@ scriptArg = (fst <$> operatorname) -- other script, and then reparsing it would take time exponential in -- the nesting depth. scripted :: Maybe Bool -> Bool -> Exp -> TP Exp -scripted limits convertible a = try $ do +scripted limits convertible a = do let sub1 = symbol "_" >> scriptArg -- see #273 let sup1 = (symbol "^" >> scriptArg) <|> primes scripts <- (do m <- sub1 diff --git a/test/reader/tex/nested_scripts_error_performance.test b/test/reader/tex/nested_scripts_error_performance.test new file mode 100644 index 00000000..29d35524 --- /dev/null +++ b/test/reader/tex/nested_scripts_error_performance.test @@ -0,0 +1,7 @@ +<<< tex +x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x\right)}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +>>> native +x^{x^{x^{x^{x\right)}}}}}}}}}}}}}}}}}}}} + ^ +unexpected control sequence \right +expecting "%", "\\label", "\\tag", "\\nonumber", whitespace or "\\allowbreak"