LaTeX reader: Fixed regression introduced with last commit.

Tests now pass again.
This commit is contained in:
John MacFarlane 2014-05-03 18:34:23 -07:00
parent 743dac493f
commit 2ba7873086

View file

@ -852,18 +852,18 @@ braced' = try $ char '{' *> manyTill (satisfy (/='}')) (char '}')
include' :: IncludeParser
include' = do
name <- try $ do
fs' <- try $ do
char '\\'
try (string "include")
<|> try (string "input")
<|> string "usepackage"
-- skip options
skipMany $ try $ char '[' *> (manyTill anyChar (char ']'))
fs <- (map trim . splitBy (==',')) <$> braced'
name <- try (string "include")
<|> try (string "input")
<|> string "usepackage"
-- skip options
skipMany $ try $ char '[' *> (manyTill anyChar (char ']'))
fs <- (map trim . splitBy (==',')) <$> braced'
return $ if name == "usepackage"
then map (flip replaceExtension ".sty") fs
else map (flip replaceExtension ".tex") fs
pos <- getPosition
let fs' = if name == "usepackage"
then map (flip replaceExtension ".sty") fs
else map (flip replaceExtension ".tex") fs
containers <- getState
let fn = case containers of
(f':_) -> f'