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)

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to