[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / compiler / rename / RnNames.lhs
index 549137a..7fad74c 100644 (file)
@@ -15,7 +15,8 @@ import CmdLineOpts    ( opt_NoImplicitPrelude, opt_WarnDuplicateExports,
                      )
 
 import HsSyn   ( HsModule(..), ImportDecl(..), HsDecl(..), 
-                 IE(..), ieName,
+                 IE(..), ieName, 
+                 ForeignDecl(..), ExtName(..), ForKind(..),
                  FixityDecl(..),
                  collectTopBinders
                )
@@ -224,6 +225,21 @@ importsFromLocalDecls rec_exp_fn (HsModule mod _ _ _ fix_decls decls _)
       = mapRn do_one (bagToList (collectTopBinders binds))     `thenRn` \ val_avails ->
        returnRn (val_avails ++ avails)
 
+    -- foreign import declaration
+    getLocalDeclBinders avails (ForD (ForeignDecl nm (FoImport _) _ _ _ loc))
+      = do_one (nm,loc)                            `thenRn` \ for_avail ->
+       returnRn (for_avail : avails)
+
+    -- foreign import declaration
+    getLocalDeclBinders avails (ForD (ForeignDecl nm FoLabel _ _ _ loc))
+      = do_one (nm,loc)                            `thenRn` \ for_avail ->
+       returnRn (for_avail : avails)
+
+    -- foreign export dynamic declaration
+    getLocalDeclBinders avails (ForD (ForeignDecl nm FoExport _ Dynamic _ loc))
+      = do_one (nm,loc)                            `thenRn` \ for_avail ->
+       returnRn (for_avail : avails)
+
     getLocalDeclBinders avails decl
       = getDeclBinders newLocalName decl       `thenRn` \ avail ->
        case avail of