That is sort of correct, it is more fine grain than line, but also refers to an external file/name.

#LINE ==> where you are in your *haskell* source file (because perhaps you moved line because of #includes, etc).

#GENERATED ==> This is part of your Haskell program, but this source was derived (generated or quoted) from
*another source file*.
#GENERATED does not alter the internal SrcSpan's for this module in anyway, much like {-# SCC ... and other pragmas.

A good example is happy. The actions are actually GENERATED from the *.y file. The idea is that you can use Hpc to get coverage of a *grammar*, checking that you have actually tested your complete parser. Reading the machine generated
Haskell is painful :-)

I'm open to other named than GENERATED. The file aspect is just a name, it could be a component name, the usage is domain specific. We could also generalize, and have lines ranges, as well an spans.

Does this help? What do you think?

Andy

On Dec 29, 2006, at 1:02 AM, Simon Peyton-Jones wrote:

Andy, what's this about? GHC already understands #LINE pragmas a la cpp. Is that what you wanted? Your pragma looks more fine- grained than that, I guess.

Simon

| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:cvs-all- [EMAIL PROTECTED]
| On Behalf Of Andy Gill
| Sent: 29 December 2006 07:36
| To: [EMAIL PROTECTED]
| Subject: patch applied (ghc): Adding a GENERATED pragma
|
| Thu Dec 28 23:29:48 PST 2006  [EMAIL PROTECTED]
|   * Adding a GENERATED pragma
|
|   Adding a {-# GENERATED "SourceFile" SourceSpan #-} <expr> pragma.
| This will be used to generate coverage for tool generated (or quoted)
| code.
|   The pragma states the the expression was generated/quoted from the
| stated
|   source file and source span.
|
|
|     M ./compiler/deSugar/Coverage.lhs -3 +10
|     M ./compiler/deSugar/DsMeta.hs +1
|     M ./compiler/hsSyn/HsExpr.lhs +6
|     M ./compiler/parser/Lexer.x +3
|     M ./compiler/parser/Parser.y.pp -1 +17
|     M ./compiler/rename/RnExpr.lhs +3
|     M ./compiler/typecheck/TcExpr.lhs +3
|     M ./compiler/typecheck/TcHsSyn.lhs +4
|
| _______________________________________________
| Cvs-ghc mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/cvs-ghc


_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to