diff --git a/bower.json b/bower.json index 8c2b7c4..188a8cc 100644 --- a/bower.json +++ b/bower.json @@ -27,14 +27,15 @@ "purescript-integers": "master", "purescript-lists": "master", "purescript-maybe": "master", + "purescript-prelude": "master", "purescript-strings": "master", "purescript-transformers": "master", - "purescript-unicode": "master", - "purescript-generics-rep": "master" + "purescript-unicode": "master" }, "devDependencies": { "purescript-assert": "master", "purescript-console": "master", + "purescript-effect": "master", "purescript-psci-support": "master" } } diff --git a/spago.dhall b/spago.dhall index fabd3c7..b40582a 100644 --- a/spago.dhall +++ b/spago.dhall @@ -3,7 +3,6 @@ [ "arrays" , "assert" , "console" - , "generics-rep" , "effect" , "either" , "foldable-traversable" diff --git a/src/Text/Parsing/Parser/Token.purs b/src/Text/Parsing/Parser/Token.purs index 1b2f023..0f55538 100644 --- a/src/Text/Parsing/Parser/Token.purs +++ b/src/Text/Parsing/Parser/Token.purs @@ -28,7 +28,7 @@ import Control.Monad.State (gets, modify_) import Control.MonadPlus (guard, (<|>)) import Data.Array as Array import Data.Char (fromCharCode, toCharCode) -import Data.Char.Unicode (digitToInt, isAlpha, isAlphaNum, isDigit, isHexDigit, isOctDigit, isSpace, isUpper) +import Data.Char.Unicode (isAlpha, isAlphaNum, isDecDigit, isHexDigit, isOctDigit, isSpace, isUpper, hexDigitToInt) import Data.Char.Unicode as Unicode import Data.Either (Either(..)) import Data.Foldable (foldl, foldr) @@ -551,7 +551,7 @@ makeTokenParser (LanguageDef languageDef) op :: Char -> Maybe Number -> Maybe Number op _ Nothing = Nothing op d (Just f) = do - int' <- digitToInt d + int' <- hexDigitToInt d pure $ ( f + toNumber int' ) / 10.0 exponent' :: ParserT String m Number @@ -600,7 +600,7 @@ makeTokenParser (LanguageDef languageDef) where folder :: Maybe Int -> Char -> Maybe Int folder Nothing _ = Nothing - folder (Just x) d = ((base * x) + _) <$> digitToInt d + folder (Just x) d = ((base * x) + _) <$> hexDigitToInt d ----------------------------------------------------------- -- Operators & reserved ops @@ -780,9 +780,9 @@ inCommentSingle (LanguageDef languageDef) = -- Helper functions that should maybe go in Text.Parsing.Parser.String -- ------------------------------------------------------------------------- --- | Parse a digit. Matches any char that satisfies `Data.Char.Unicode.isDigit`. +-- | Parse a digit. Matches any char that satisfies `Data.Char.Unicode.isDecDigit`. digit :: forall m . Monad m => ParserT String m Char -digit = satisfy isDigit "digit" +digit = satisfy isDecDigit "digit" -- | Parse a hex digit. Matches any char that satisfies `Data.Char.Unicode.isHexDigit`. hexDigit :: forall m . Monad m => ParserT String m Char