NoRedInk / haskell-verify-examples

WIP
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Group comments #24

Closed stoeffel closed 3 years ago

stoeffel commented 3 years ago

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).

stoeffel commented 3 years ago

I'd love a review (best to go commit by commit) @micahhahn and I'm curious about what you think.