This fixes a bug (see bdeaafbd13a90ec315601ce76fd41090a9711085) and changes the behaviour of context for examples.
In order to fix the bug I had to group comments together based on how they are in the source.
Unfortunately, haskell-src-exts doesn't give us a clue besides SrcSpan about if a line comment is part of a bigger block of line comments. I've grouped comments based on SrcSpan. Additionally, a context is now in scope for the following examples of the comment block. This also solves the import issue.
Before we would just join all the context blocks together which lead to broken context modules, because definitions could be interleaved with imports. I think this behaviour is quite nice (see test/assets changes).
This fixes a bug (see bdeaafbd13a90ec315601ce76fd41090a9711085) and changes the behaviour of context for examples. In order to fix the bug I had to group comments together based on how they are in the source. Unfortunately, haskell-src-exts doesn't give us a clue besides
SrcSpan
about if a line comment is part of a bigger block of line comments. I've grouped comments based onSrcSpan
. Additionally, a context is now in scope for the following examples of the comment block. This also solves theimport
issue. Before we would just join all the context blocks together which lead to broken context modules, because definitions could be interleaved with imports. I think this behaviour is quite nice (seetest/assets
changes).