Skip to content

Commit

Permalink
* Minor fixes
Browse files Browse the repository at this point in the history
* Cabal update
  • Loading branch information
spockz committed Oct 15, 2011
1 parent 65e8c52 commit 619d3df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lhs2TeX-hl.cabal
@@ -1,5 +1,5 @@
Name: lhs2TeX-hl Name: lhs2TeX-hl
Version: 0.1.4.4 Version: 0.1.4.5
Cabal-Version: >= 1.6 Cabal-Version: >= 1.6
License: MIT License: MIT
Author: Alessandro Vermeulen <me@alessandrovermeulen.me> Author: Alessandro Vermeulen <me@alessandrovermeulen.me>
Expand Down Expand Up @@ -29,6 +29,8 @@ Executable lhs2TeX-hl
, haskell-src-exts == 1.11.1 , haskell-src-exts == 1.11.1
, syb >= 0.1.0.1 , syb >= 0.1.0.1
, cmdargs >= 0.1 , cmdargs >= 0.1
, filepath == 1.2.0.0
, uu-parsinglib >= 2.7
hs-source-dirs: src hs-source-dirs: src
Other-Modules: Data.Data, Data.List.Utils, Data.String.Utils, Other-Modules: Data.Data, Data.List.Utils, Data.String.Utils,
Language.LaTeX, Language.Markup, Literate.Agda, Language.LaTeX, Language.Markup, Literate.Agda,
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Common.hs
@@ -1,4 +1,4 @@
module Base.Common where module Base.Common where


programVersion = "0.1.4.3" programVersion = "0.1.4.5"
programName = "lhs2TeX-hl" programName = "lhs2TeX-hl"
8 changes: 3 additions & 5 deletions src/LiterateHighlighter.hs
Expand Up @@ -61,10 +61,7 @@ main = do args <- cmdArgsRun standard
hSetEncoding stderr utf8 hSetEncoding stderr utf8


discoverFiles :: FilePath -> IO [FilePath] discoverFiles :: FilePath -> IO [FilePath]
discoverFiles fp = do contents <- fmap ( map ((base ++) . fromJust) discoverFiles fp = do contents <- fmap (\xs -> [base ++ x | Just x <- map runPInclude (lines xs)])
. filter isJust
. map runPInclude
. lines)
(readFile fp) (readFile fp)
files <- mapM discoverFiles contents files <- mapM discoverFiles contents
return (nub $ fp : concat files) return (nub $ fp : concat files)
Expand All @@ -75,7 +72,8 @@ discoverFiles fp = do contents <- fmap ( map ((base ++) . fromJust)
runPInclude = runParse pInclude runPInclude = runParse pInclude


runParse :: Show t => Parser t -> String -> Maybe t runParse :: Show t => Parser t -> String -> Maybe t
runParse p inp = let r@(a, errors) = PCC.parse ( (,) <$> p <*> pEnd) (createStr (LineColPos 0 0 0) inp) runParse p inp = let r@(a, errors) = PCC.parse ( (,) <$> p <*> pEnd)
(createStr (LineColPos 0 0 0) inp)
in if null errors then in if null errors then
Just a Just a
else else
Expand Down

0 comments on commit 619d3df

Please sign in to comment.