Renamed parseFromStr -> parseFromString.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@779 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
c1c30a7664
commit
caef362065
2 changed files with 6 additions and 6 deletions
|
@ -38,7 +38,7 @@ module Text.Pandoc.ParserCombinators (
|
||||||
blanklines,
|
blanklines,
|
||||||
enclosed,
|
enclosed,
|
||||||
stringAnyCase,
|
stringAnyCase,
|
||||||
parseFromStr,
|
parseFromString,
|
||||||
lineClump,
|
lineClump,
|
||||||
charsInBalanced
|
charsInBalanced
|
||||||
) where
|
) where
|
||||||
|
@ -108,8 +108,8 @@ stringAnyCase (x:xs) = try (do
|
||||||
return (firstChar:rest))
|
return (firstChar:rest))
|
||||||
|
|
||||||
-- | Parse contents of 'str' using 'parser' and return result.
|
-- | Parse contents of 'str' using 'parser' and return result.
|
||||||
parseFromStr :: GenParser tok st a -> [tok] -> GenParser tok st a
|
parseFromString :: GenParser tok st a -> [tok] -> GenParser tok st a
|
||||||
parseFromStr parser str = try $ do
|
parseFromString parser str = try $ do
|
||||||
oldInput <- getInput
|
oldInput <- getInput
|
||||||
setInput str
|
setInput str
|
||||||
result <- parser
|
result <- parser
|
||||||
|
|
|
@ -591,14 +591,14 @@ rawTableLine indices = do
|
||||||
-- Parse a table line and return a list of lists of blocks (columns).
|
-- Parse a table line and return a list of lists of blocks (columns).
|
||||||
tableLine indices = try $ do
|
tableLine indices = try $ do
|
||||||
rawline <- rawTableLine indices
|
rawline <- rawTableLine indices
|
||||||
mapM (parseFromStr (many plain)) rawline
|
mapM (parseFromString (many plain)) rawline
|
||||||
|
|
||||||
-- Parse a multiline table row and return a list of blocks (columns).
|
-- Parse a multiline table row and return a list of blocks (columns).
|
||||||
multilineRow indices = try $ do
|
multilineRow indices = try $ do
|
||||||
colLines <- many1 (rawTableLine indices)
|
colLines <- many1 (rawTableLine indices)
|
||||||
option "" blanklines
|
option "" blanklines
|
||||||
let cols = map unlines $ transpose colLines
|
let cols = map unlines $ transpose colLines
|
||||||
mapM (parseFromStr (many plain)) cols
|
mapM (parseFromString (many plain)) cols
|
||||||
|
|
||||||
-- Calculate relative widths of table columns, based on indices
|
-- Calculate relative widths of table columns, based on indices
|
||||||
widthsFromIndices :: Int -- Number of columns on terminal
|
widthsFromIndices :: Int -- Number of columns on terminal
|
||||||
|
@ -628,7 +628,7 @@ tableWith headerParser lineParser footerParser = try $ do
|
||||||
(rawHeads, aligns, indices) <- headerParser
|
(rawHeads, aligns, indices) <- headerParser
|
||||||
lines <- many1Till (lineParser indices) footerParser
|
lines <- many1Till (lineParser indices) footerParser
|
||||||
caption <- option [] tableCaption
|
caption <- option [] tableCaption
|
||||||
heads <- mapM (parseFromStr (many plain)) rawHeads
|
heads <- mapM (parseFromString (many plain)) rawHeads
|
||||||
state <- getState
|
state <- getState
|
||||||
let numColumns = stateColumns state
|
let numColumns = stateColumns state
|
||||||
let widths = widthsFromIndices numColumns indices
|
let widths = widthsFromIndices numColumns indices
|
||||||
|
|
Loading…
Reference in a new issue