[Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

Niklas Hambüchen mail at nh2.me
Tue Aug 20 12:00:01 CEST 2013

On 20/08/13 18:19, Niklas Broberg wrote:
> Sadly not - it's theoretically impossible. The fact that you can put
> comments literally wherever, means that it's impossible to treat them as
> nodes of the AST. E.g.
>   f {- WHERE -} x = -- WOULD
>       -- THESE
>       do -- COMMENTS
>          a {- END -} <- g x -- UP
>          return {- ? -} a

Oh, I see what you mean.

I guess what I mean instead is:

* A lex list that contains *everything*, including comments and white space

* A full syntax tree of which each node points to (indexes) a position
in the lex list to get the precise original position; comments in
between two nodes can then be determined and more easily played with
because they are between their positions in the lex list

* An abstract syntax tree that has whitespace and comments discarded
(what HSE has now)

More information about the Haskell-Cafe mailing list