@@ -68,12 +68,12 @@ fileTo get what jsFiles noscript rtLoc file = do
68 writeFile html . renderHtml $ linkedHtml rtLoc js ms
68 writeFile html . renderHtml $ linkedHtml rtLoc js ms
69 writeFile js $ jss ++ concatMap jsModule ms
69 writeFile js $ jss ++ concatMap jsModule ms
71−getModules :: [String] -> FilePath -> IO (Either String [Module])
71+getModules :: [String] -> FilePath -> IO (Either String [([String],Module)])
72getModules uses file = do
72getModules uses file = do
73 code <- readFile file
73 code <- readFile file
74 case initialize code of
74 case initialize code of
75 Left err -> return . Left $ "Error in " ++ file ++ ":\n" ++ err
75 Left err -> return . Left $ "Error in " ++ file ++ ":\n" ++ err
76− Right modul@(Module _ _ imports _) ->
76+ Right (escs, modul@(Module _ _ imports _)) ->
77 let imps = filter (`notElem` builtInModules) $ map fst imports in
77 let imps = filter (`notElem` builtInModules) $ map fst imports in
78 case intersect uses imps of
78 case intersect uses imps of
79 x:_ -> return . Left $ "Error: Cyclic dependency. Module " ++
79 x:_ -> return . Left $ "Error: Cyclic dependency. Module " ++
@@ -81,10 +81,10 @@ getModules uses file = do
82 ems <- mapM (getModules (uses ++ imps) . toFilePath) imps
82 ems <- mapM (getModules (uses ++ imps) . toFilePath) imps
83 return $ case lefts ems of
83 return $ case lefts ems of
84− [] -> Right $ concat (rights ems) ++ [modul]
84+ [] -> Right $ concat (rights ems) ++ [(escs,modul)]
85 errs -> Left $ intercalate "\n" errs
85 errs -> Left $ intercalate "\n" errs
87−getModule :: FilePath -> IO (Either String [Module])
87+getModule :: FilePath -> IO (Either String [([String],Module)])
88getModule file = do
88getModule file = do
89 code <- readFile file
89 code <- readFile file
90 return . fmap (:[]) $ initialize code
90 return . fmap (:[]) $ initialize code