On Aug 20, 2013, at 02: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
>
+1
When I worked on the font-lock support for haskell-mode, the irony
of trying to approximate the classification that the hugs/ghc/whatnot parser
was already doing wasn't lost on me. I still would like to tap into more
of the knowledge generated and lost in the compiler:
- A list of all tokens
This is not using haskell-src-exts, but the Haskell Refactorer has a
structure to keep a parallel tree of tokens indexed by SrcSpan, which
attempts to allocate comments to the appropriate point.
See
https://github.com/alanz/HaRe/blob/master/src/Language/Haskell/Refact/Utils/TokenUtils.hs.
It does
On 20/08/13 11:02, JP Moresmau wrote:
> BuildWrapper has some code that tries to link back the comments to the
> declaration from the AST generated by haskell-src-exts and the comments.
> See
> https://github.com/JPMoresmau/BuildWrapper/blob/master/src/Language/Haskell/BuildWrapper/Src.hs.
> The un
On Tue, Aug 20, 2013 at 11:19 AM, Niklas Broberg wrote:
> On Tue, Aug 20, 2013 at 10:48 AM, Niklas Hambüchen wrote:
2) Have you considered downloading the all-of-Hackage tarball and
>>
> running haskell-src-exts over it to get a benchmark of how much HSE can
>> already parse of the Haskell code
BuildWrapper has some code that tries to link back the comments to the
declaration from the AST generated by haskell-src-exts and the comments.
See
https://github.com/JPMoresmau/BuildWrapper/blob/master/src/Language/Haskell/BuildWrapper/Src.hs.
The unit tests provide some samples:
https://github.co
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
On 20/08/13 09:48, Niklas Hambüchen wrote:
> Nice!
>
> I hope that haskell-suite will eventually become awesome and solve most
> of our automation-on-Haskell-code needs.
>
> Two questions:
>
> 1) My most desired feature would be a syntax tree that does not pluck
> pluck comments out and make me
Hi Niklas,
1) My most desired feature would be a syntax tree that does not pluck
> pluck comments out and make me treat them separately. It looks much
> easier to me to have a fully descriptive tree and (filter . concatMap) /
> traverse them out in some way than getting a list of comments and havi
Nice!
I hope that haskell-suite will eventually become awesome and solve most
of our automation-on-Haskell-code needs.
Two questions:
1) My most desired feature would be a syntax tree that does not pluck
pluck comments out and make me treat them separately. It looks much
easier to me to have a f
10 matches
Mail list logo