Parse OPTIONS properly and cache the result.
authorLemmih <lemmih@gmail.com>
Fri, 10 Mar 2006 01:10:35 +0000 (01:10 +0000)
committerLemmih <lemmih@gmail.com>
Fri, 10 Mar 2006 01:10:35 +0000 (01:10 +0000)
commitd700953c29ffe78d6530f734f2820c796e5ec6e0
tree6034e6d89b526ae938ea6b1a7bfc3968a9a16a19
parent370848f10c0b4aa9faabcd28e090b0a1e9ad9fd6
Parse OPTIONS properly and cache the result.

Use the lexer to parse OPTIONS, LANGUAGE and INCLUDE pragmas.
This gives us greater flexibility and far better error
messages. However, I had to make a few quirks:
  * The token parser is written manually since Happy doesn't
    like lexer errors (we need to extract options before the
    buffer is passed through 'cpp'). Still better than
    manually parsing a String, though.
  * The StringBuffer API has been extended so files can be
    read in blocks.
I also made a new field in ModSummary called ms_hspp_opts
which stores the updated DynFlags. Oh, and I took the liberty
of moving 'getImports' into HeaderInfo together with
'getOptions'.
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/GHC.hs
ghc/compiler/main/GetImports.hs [deleted file]
ghc/compiler/main/HeaderInfo.hs [new file with mode: 0644]
ghc/compiler/main/HscMain.lhs
ghc/compiler/main/HscTypes.lhs
ghc/compiler/package.conf.in
ghc/compiler/parser/Lexer.x
ghc/compiler/utils/StringBuffer.lhs