Re: Note [Api annotations]

2016-07-20 Thread Alan & Kim Zimmerman
Hopefully at a future date they will be a part of the AST itself, so this
will be clearer.

In reality, looking at Parser.y is not enough, as there are some workings
in RdrHsSyn.hs too, and the process of attachment in Parser.y is sometimes
quite complex.

Basically the best reference is indeed ghc-exactprint, being an application
that expressly makes use of all of them.

Alan

On Wed, Jul 20, 2016 at 2:01 PM, Matthew Pickering <
matthewtpicker...@gmail.com> wrote:

> On Wed, Jul 20, 2016 at 12:22 PM, Ben Gamari  wrote:
> > Matthew Pickering  writes:
> >
> >> These comments are meant to indicate which annotations each AST
> >> fragment has. However, they are rarely kept up to date and ultimately
> >> not that useful. If someone wants to
> >> know then it is easier to look at the `Annotate` module in
> >> `ghc-exactprint`where this information also exists programatically.
> >>
> > Hmm, the fact that this module is outside of GHC is a bit unfortunate.
> > If I'm looking at a random GHC commit from a year ago how am I to know
> > which annotations I can expect? I guess the testsuite?
>
> The only reliable way is to look at `Parser.y`.
>
> >
> > Cheers,
> >
> > - Ben
> >
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Note [Api annotations]

2016-07-20 Thread Matthew Pickering
On Wed, Jul 20, 2016 at 12:22 PM, Ben Gamari  wrote:
> Matthew Pickering  writes:
>
>> These comments are meant to indicate which annotations each AST
>> fragment has. However, they are rarely kept up to date and ultimately
>> not that useful. If someone wants to
>> know then it is easier to look at the `Annotate` module in
>> `ghc-exactprint`where this information also exists programatically.
>>
> Hmm, the fact that this module is outside of GHC is a bit unfortunate.
> If I'm looking at a random GHC commit from a year ago how am I to know
> which annotations I can expect? I guess the testsuite?

The only reliable way is to look at `Parser.y`.

>
> Cheers,
>
> - Ben
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Note [Api annotations]

2016-07-20 Thread Ben Gamari
Matthew Pickering  writes:

> These comments are meant to indicate which annotations each AST
> fragment has. However, they are rarely kept up to date and ultimately
> not that useful. If someone wants to
> know then it is easier to look at the `Annotate` module in
> `ghc-exactprint`where this information also exists programatically.
>
Hmm, the fact that this module is outside of GHC is a bit unfortunate.
If I'm looking at a random GHC commit from a year ago how am I to know
which annotations I can expect? I guess the testsuite?

Cheers,

- Ben



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Note [Api annotations]

2016-07-20 Thread Matthew Pickering
These comments are meant to indicate which annotations each AST
fragment has. However, they are rarely kept up to date and ultimately
not that useful. If someone wants to
know then it is easier to look at the `Annotate` module in
`ghc-exactprint`where this information also exists programatically.

On Wed, Jul 20, 2016 at 9:24 AM, Ömer Sinan Ağacan  wrote:
> I see some weird comments like
>
> --  - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen',
> --  'ApiAnnotation.AnnVbar','ApiAnnotation.AnnComma',
> --  'ApiAnnotation.AnnClose'
>
> -- For details on above see note [Api annotations] in ApiAnnotation
>
> in some files, but Note [Api annotations] in compiler/parser/ApiAnnotation.hs
> doesn't say anything about those comments. Can someone update the note to
> explain what are those comments for?
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Note [Api annotations]

2016-07-20 Thread Ömer Sinan Ağacan
I see some weird comments like

--  - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen',
--  'ApiAnnotation.AnnVbar','ApiAnnotation.AnnComma',
--  'ApiAnnotation.AnnClose'

    -- For details on above see note [Api annotations] in ApiAnnotation

in some files, but Note [Api annotations] in compiler/parser/ApiAnnotation.hs
doesn't say anything about those comments. Can someone update the note to
explain what are those comments for?
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs