Commit 05bead0e authored by sof's avatar sof
Browse files

[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.
parent be2cd17f
-----------------------------------------------------------------------------
-- $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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment