Help! doctest multi-line syntax

Hi !

While porting some scotty docstrings to doctest (Add doctest · Issue #353 · scotty-web/scotty · GitHub) I started getting an uninformative “unterminated multi-line command” syntax error, see e.g. the build log

which refers to this bit of code: WIP add doctest by ocramz · Pull Request #354 · scotty-web/scotty · GitHub

As far as I can see from the official examples (GitHub - sol/doctest: An implementation of Python's doctest for Haskell) my syntax looks ok so I’m really stumped at this point.

Do we have a doctest expert in the house? Thanks in advance!

Hi @quchen , I got excited about doctest after seeing your wonderful work on gen art Haddock+Doctest+Cairo = ♥ . Have you seen the sort of error message before? Thanks!

@ocramz It’s the empty newline on line number 454

1 Like

Huh, thanks a lot! Great catch. I’d have never figured it out. The Haddock lexer is doing some weird stuff there I suppose.

it’s likely a doctest parser issue, empty newlines in multi line blocks work fine in ghci

1 Like