packages feed

HaTeX-meta 1.1.0 → 1.1.1

raw patch · 3 files changed

+43/−13 lines, 3 filesdep ~haddock

Dependency ranges changed: haddock

Files

HaTeX-meta.cabal view
@@ -1,5 +1,5 @@ Name: HaTeX-meta-Version: 1.1.0+Version: 1.1.1 Cabal-Version: >= 1.6 Build-Type: Simple License: BSD3@@ -21,7 +21,7 @@   Build-depends: base == 4.*                , mtl  == 2.*                , haskell-src-exts == 1.11.*-               , haddock == 2.9.*+               , haddock >= 2.9.0 && < 2.9.3                , ghc  == 7.*                , parsec == 3.*                , containers == 0.4.*
MetaHaTeX.hs view
@@ -13,7 +13,7 @@ import Text.Parsec.String import Data.Map hiding (filter) import System.FilePath (dropFileName)-import System.Directory (createDirectoryIfMissing)+import System.Directory (createDirectoryIfMissing,doesFileExist) import Data.Char (isAlpha) import System.IO (hFlush,stdout) import Control.Monad (filterM)@@ -34,11 +34,18 @@            -> ModuleName -- New module name monadMName mn = mn ++ ".Monad" +-- | We skip to parse files in this list.+blacklist :: [ModuleName]+blacklist =+ [ -- "Text.LaTeX.Base.Parser" -- See issue #1: <https://github.com/Daniel-Diaz/HaTeX/issues/1>+   ]+ -- | All exposed modules of HaTeX. allExposed :: IO [ModuleName]-allExposed =+allExposed =   fmap-  (fmap (intercalate "." . components)+  (  filter (`notElem` blacklist)+   . fmap (intercalate "." . components)    . exposedModules . condTreeData . fromJust . condLibrary)    $ readPackageDescription silent "HaTeX.cabal" @@ -47,13 +54,26 @@ moduleList =  allExposed >>=   filterM-   (fmap (hatexPragma . fromParseResult) . parseFileS . mNameToFilePath)+   (fmap hatexPragma . parseFileS . mNameToFilePath) -parseFileS :: FilePath -> IO (ParseResult Module)-parseFileS fp = parseFile fp `catch` \e -> do- let name = filePathToMName fp- putStrLn $ "HaTeX-meta: The module " ++ name ++ " does not exist."- return $ ParseOk $ Module loc0 (LH.ModuleName name) [] Nothing Nothing [] []+parseFileS :: FilePath -> IO Module+parseFileS fp =+ (do exst <- doesFileExist fp+     if exst then do r <- parseFileWithMode (defaultParseMode { fixities = Nothing , extensions = [CPP] }) fp+                     case r of+                      ParseFailed l s -> do putStrLn $ "HaTeX-meta: Parsing error at " ++ prettyPrint l+                                                    ++ " (" ++ fp ++ "): " ++ s ++ "."+                                            return defaultModule+                      ParseOk m -> return m+             else return defaultModule ) `catch` \e -> do+     -- When a exception is raised...+     putStrLn $ "HaTeX-meta: There was an exception reading " ++ name ++ " module."+     putStrLn "The exception was:"+     print e+     return defaultModule+   where+    name = filePathToMName fp+    defaultModule = Module loc0 (LH.ModuleName name) [] Nothing Nothing [] []  -- | Check if a module has the HaTeX /MakeMonadic/ option: --@@ -115,7 +135,7 @@ getHSInfo mn i = do  let fp = mNameToFilePath mn  -- Parsing module- pr <- parseFile fp+ pr <- parseFileWithMode (defaultParseMode { fixities = Nothing }) fp  (Module _ _ pragmas _ _ imports decls)    <- case pr of        ParseOk x -> return x@@ -312,7 +332,7 @@    ""  , "/For contributors: This module was automatically generated by HaTeX-meta./"  , "/So, please, don't make any change here directly, because/"- , "/this is intended to be generated from/"+ , "/this is intended to be generated automatically from/"  , "\"" ++ mn ++ "\" /module via HaTeX-meta,/"  , "/and therefore, changes must to be done in these places./"    ]@@ -333,7 +353,9 @@  main :: IO () main = do+ putStrLn "HaTeX-meta: Modules to be processed:"  mlist <- moduleList+ mapM_ (putStrLn . ("* " ++)) mlist  is <- createInterfaces [] mlist  mapM_ (\m -> do putStr $ "HaTeX-meta: Processing " ++ m ++ "... "                  hFlush stdout
ReleaseNotes view
@@ -1,5 +1,13 @@ HaTeX-meta Release Notes
 -- From version 1.0.0+
+>>> 1.1.1
+
+* More safe parsing of modules.
+* More restricted dependencies of haddock.
+* Added blacklist to avoid parsing of problematic modules.
+* Fixed a bug when parsing modules with unknown operator fixities.
+* Added CPP extension while parsing modules.
  >>> 1.1.0