on master help sign in
Extra check in parseInteger

https://github.com/idris-lang/Idris-dev/issues/3743

commit5ddb7a34db379ee605bdf804892bd76726c686f4 authorDmitry Nikulin <Pastafarianist@users.noreply.github.com> dateFri 7 Apr 2017, 14:25 (10 years ago) parentc56feb8
1 file changed+3−1
libs/base/Data/String.idr+3−1
libs/base/Data/String.idr+3−1
@@ -49,7 +49,9 @@ parseInteger s = parseIntTrimmed (trim s)
4949 then map (\y => negate (fromInteger y)) (parseNumWithoutSign (unpack xs) 0)
5050 else if (x == '+')
5151 then map fromInteger (parseNumWithoutSign (unpack xs) (cast {from=Int} 0))
52− else map fromInteger (parseNumWithoutSign (unpack xs) (cast (ord x - ord '0')))
52+ else if (x >= '0' && x <= '9')
53+ then map fromInteger (parseNumWithoutSign (unpack xs) (cast (ord x - ord '0')))
54+ else Nothing
5355
5456
5557||| Convert a number string to a Double.