Skip to content

Commit

Permalink
* Speedup by pattern matching, we only are able to parse includes tha…
Browse files Browse the repository at this point in the history
…t start on

  column 0
  • Loading branch information
spockz committed Oct 15, 2011
1 parent 619d3df commit 745ea70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LiterateHighlighter.hs
Expand Up @@ -69,7 +69,8 @@ discoverFiles fp = do contents <- fmap (\xs -> [base ++ x | Just x <- map runPI
base = takeDirectory fp ++ "/"


runPInclude = runParse pInclude
runPInclude xs@('%':_) = runParse pInclude xs
runPInclude _ = Nothing

runParse :: Show t => Parser t -> String -> Maybe t
runParse p inp = let r@(a, errors) = PCC.parse ( (,) <$> p <*> pEnd)
Expand Down

0 comments on commit 745ea70

Please sign in to comment.