Improved efficiency of hexNum parser.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1568 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
d4d99d281d
commit
532e52f2d4
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ numRef = do
|
|||
return $ chr $ num
|
||||
|
||||
hexNum :: GenParser Char st Int
|
||||
hexNum = oneOf "Xx" >> many1 hexDigit >>= return . read . ("0x" ++)
|
||||
hexNum = oneOf "Xx" >> many1 hexDigit >>= return . read . (\xs -> '0':'x':xs)
|
||||
|
||||
decNum :: GenParser Char st Int
|
||||
decNum = many1 digit >>= return . read
|
||||
|
|
Loading…
Add table
Reference in a new issue