From: sof Date: Tue, 16 Jul 2002 06:42:04 +0000 (+0000) Subject: [project @ 2002-07-16 06:42:04 by sof] X-Git-Tag: Approx_11550_changesets_converted~1852 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=05bead0e7116e21417d7c88324fe86d4dcb44048;p=ghc-hetmet.git [project @ 2002-07-16 06:42:04 by sof] Treat ';' and '{' as word separators, so that from input like like "{import Foo" and ";;;;import Foo", the 'Foo' imports are identified. --- diff --git a/ghc/compiler/main/GetImports.hs b/ghc/compiler/main/GetImports.hs index 1488aa3..50e374e 100644 --- a/ghc/compiler/main/GetImports.hs +++ b/ghc/compiler/main/GetImports.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: GetImports.hs,v 1.8 2001/06/27 11:11:03 simonmar Exp $ +-- $Id: GetImports.hs,v 1.9 2002/07/16 06:42:04 sof Exp $ -- -- GHC Driver program -- @@ -83,6 +83,10 @@ clean s keep acc ('-':'-':cs) = cons acc (linecomment cs) keep acc ('{':'-':'#':' ':cs) = cons acc (cons "#-{" (keep "" cs)) keep acc ('{':'-':cs) = cons acc (runcomment (0::Int) cs) -- -} + keep acc ('{':cs) = cons acc (keep "" cs) + keep acc (';':cs) = cons acc (keep "" cs) + -- treat ';' and '{' as word separators so that stuff + -- like "{import A;" and ";;;;import B;" are handled correctly. keep acc (c:cs) = keep (c:acc) cs cons [] xs = xs