Chaddaï Fouché wrote:
This patch add four exported functions to GHC.hs and one to Lexer.x,
it allows one to extract a token stream from a source file. This token
stream include comments which means it contains everything needed to
recreate Haddock for example in a more independent fashion (the
current one is completely interleaved with GHC and complicate a lot of
code).
In addition, three functions in GHC.hs work on a stream of pair of
(Located Token, String), the second member corresponding to the source
of the first, one function extract this from a file and another
convert it back to a String virtually identical to the source file
(except for insignificant whitespace). With this we can support the
model used by HaRe : get the AST and the token stream, modify the AST,
propagate the modifications to the token stream, pretty-print this
token stream.

Normally, this patch shouldn't interfere with anything in GHC (except
that there will be some very small changes to make when the new API
roll in).


Thanks Chaddaï.  Your patch seems to have some conflict markers in it, though:

hunk ./compiler/parser/Lexer.x 1610
+v v v v v v v
hunk ./compiler/parser/Lexer.x 1612
+*************
+rawTokenStreamBit = 19 -- producing a token stream with all comments included
+^ ^ ^ ^ ^ ^ ^
hunk ./compiler/parser/Lexer.x 1636
+v v v v v v v
hunk ./compiler/parser/Lexer.x 1638
+*************
+rawTokenStreamEnabled flags = testBit flags rawTokenStreamBit
+^ ^ ^ ^ ^ ^ ^


Could you fix these up and resubmit?

Cheers,
        Simon

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

Reply via email to