--- a/tools/pas2c/Pas2C.hs Sat Jul 02 17:56:10 2016 +0200
+++ b/tools/pas2c/Pas2C.hs Sat Jul 09 22:40:44 2016 +0300
@@ -1,5 +1,4 @@
{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE FlexibleContexts #-}
module Pas2C where
import Text.PrettyPrint.HughesPJ
@@ -298,6 +297,7 @@
mapM_ (id2C IOInsert . setBaseType BTUnit) unitIds
return $ vcat . map (\i -> text $ "#include \"" ++ i ++ ".h\"") $ uses2List uses
where
+ injectNamespace :: Identifier -> State RenderState ()
injectNamespace (Identifier i _) = do
getNS <- gets (flip Map.lookup . namespaces)
modify (\s -> s{currentScope = Map.unionWith (++) (fromMaybe Map.empty (getNS i)) $ currentScope s})