-
Notifications
You must be signed in to change notification settings - Fork 46
takeTill
performs exponential backtracking in environments
#122
Comments
Actually, I think this might be mostly my fault. Here's one of the environments I was trying to expand: \begin{code}
main :: IO ()
main = do
bool <- read
withSomeSBool (toSBool bool) $ !\annotate{1}!
\(_ :: SBool b) -> !\annotate{2}!
runLogging @b program !\annotate{3}!
\end{code} which is a |
What is the result if you use the following parser configuration?
The problem might be with the |
It works as expected with the given |
Great! I'm glad that worked for you. Is the example code above enough to break the parser using default configuration? |
The example code above does break the parser as expected. However, in long documents, this broken parser seems to result in the backtracking issue described above---it will keep consuming input outside of the |
parseLaTeX
performs exponential amounts of work in the number of environments. I have two files,book2.txt
andbook3.txt
which are roughly the same size in bytes, but the latter has ~3x as many environments.book2.txt
parses quickly, but I haven't been patient enough to getbook3.txt
to.The
shiatsu
program below is doing nothing more than reading the file and callingparseLaTeX
.Here's the profile information
The text was updated successfully, but these errors were encountered: