Permalink
Browse files

* Speedup by pattern matching, we only are able to parse includes tha…

…t start on

  column 0
  • Loading branch information...
spockz committed Oct 15, 2011
1 parent 619d3df commit 745ea703f7d990aaa31a2505a08bdb5c177189b4
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/LiterateHighlighter.hs
@@ -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)

0 comments on commit 745ea70

Please sign in to comment.