diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-02 08:18:03 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-02 08:18:03 +0100 |
commit | 35d213abfe27502fa34b60975c4b18ed51bfeb05 (patch) | |
tree | aab2a30ab9acbf6ab2bc51366530027eab13b8ad /compiler/parser | |
parent | 6059755e045ed8c4a8c3d48cc0ec5733bd950c0f (diff) | |
download | haskell-35d213abfe27502fa34b60975c4b18ed51bfeb05.tar.gz |
Refactor the imports of InteractiveContext
Instead of two fields
ic_toplev_scope :: [Module]
ic_imports :: [ImportDecl RdrName]
we now just have one
ic_imports :: [InteractiveImport]
with the auxiliary data type
data InteractiveImport
= IIDecl (ImportDecl RdrName) -- Bring the exports of a particular module
-- (filtered by an import decl) into scope
| IIModule Module -- Bring into scope the entire top-level envt of
-- of this module, including the things imported
-- into it.
This makes lots of code less confusing. No change in behaviour.
It's preparatory to fixing Trac #5147.
While I was at I also
* Cleaned up the handling of the "implicit" Prelude import
by adding a ideclImplicit field to ImportDecl. This
significantly reduces plumbing in the handling of
the implicit Prelude import
* Used record notation consistently for ImportDecl
Diffstat (limited to 'compiler/parser')
-rw-r--r-- | compiler/parser/Parser.y.pp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index d199fb534f..42988feeeb 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -504,7 +504,11 @@ importdecls :: { [LImportDecl RdrName] } importdecl :: { LImportDecl RdrName } : 'import' maybe_src maybe_safe optqualified maybe_pkg modid maybeas maybeimpspec - { L (comb4 $1 $6 $7 $8) (ImportDecl $6 $5 $2 $3 $4 (unLoc $7) (unLoc $8)) } + { L (comb4 $1 $6 $7 $8) $ + ImportDecl { ideclName = $6, ideclPkgQual = $5 + , ideclSource = $2, ideclSafe = $3 + , ideclQualified = $4, ideclImplicit = False + , ideclAs = unLoc $7, ideclHiding = unLoc $8 } } maybe_src :: { IsBootInterface } : '{-# SOURCE' '#-}' { True } |