in-tree API Annotations

Alan & Kim Zimmerman alan.zimm at gmail.com
Mon May 25 22:33:39 UTC 2020


I am trying to get my head around the best way to put the API annotations
into the GHC ParsedSource directly, so ghc-exactprint can move in to GHC
and make the development/testing process easier.

Prior to API Annotations, there were very few locations in the AST, as they
were added as anchor points for the annotations, being separate from the
AST and indexed to it by the SrcSpan.

I am intending to strip out the superfluous ones, in particular all the
(Located RdrName), replacing them with something like

  data ApiAnnName a = N ApiAnn a

instead. So they would still be wrapped, but the annotations would be only
ones that can occur for a RdrName, such a backticks, parens, and so on.

Does anything actually need these locations now they are there?  I am
thinking specifically of the .hie files, as the `toHie` instances seem to
make use of locations extensively.

Regards
  Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200525/aed1d282/attachment.html>


More information about the ghc-devs mailing list