numbers: ParseCharResult refactor
This commit is contained in:
parent
b1a4e1a941
commit
40251a1455
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ nat b = do
|
||||||
where
|
where
|
||||||
parseDigit : Parser Nat
|
parseDigit : Parser Nat
|
||||||
parseDigit = do
|
parseDigit = do
|
||||||
GotChar char <- parseChar (hasDigit b) id
|
GotChar char <- parseChar (hasDigit b)
|
||||||
| GotError e => throwParseError "\{show e} is not a digit"
|
| GotError e => throwParseError "\{show e} is not a digit"
|
||||||
| EndOfInput => throwParseError "End Of Input"
|
| EndOfInput => throwParseError "End Of Input"
|
||||||
case digitValue b char of
|
case digitValue b char of
|
||||||
|
@ -120,7 +120,7 @@ double = do
|
||||||
where
|
where
|
||||||
parseDigit : Parser Char
|
parseDigit : Parser Char
|
||||||
parseDigit = do
|
parseDigit = do
|
||||||
GotChar char <- parseChar (hasDigit base10) id
|
GotChar char <- parseChar (hasDigit base10)
|
||||||
| GotError e => throwParseError "\{show e} is not a digit"
|
| GotError e => throwParseError "\{show e} is not a digit"
|
||||||
| EndOfInput => throwParseError "End Of Input"
|
| EndOfInput => throwParseError "End Of Input"
|
||||||
pure char
|
pure char
|
||||||
|
|
Loading…
Add table
Reference in a new issue