Skip to content

Commit

Permalink
improved numeric parser
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTaelin committed Oct 30, 2024
1 parent 92079bc commit 9617333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Kind/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ digit = P.digit
numeric :: Parser String
numeric = do
head <- P.satisfy (`elem` "0123456789")
tail <- P.many (P.satisfy (`elem` "0123456789xb_"))
return (head : tail)
tail <- P.many (P.satisfy (`elem` "bx0123456789abcdefABCDEF_"))
return $ show (read (head : tail) :: Word64)

numeric_skp :: Parser String
numeric_skp = numeric <* skip
Expand Down

0 comments on commit 9617333

Please sign in to comment.