mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Try having only one parse function
This commit is contained in:
parent
043091b1e6
commit
bec4884028
2 changed files with 0 additions and 39 deletions
|
@ -917,22 +917,6 @@ Endi : [ Big, Little ]
|
|||
## only one byte.
|
||||
toBytes : Num *, Endi -> List U8
|
||||
|
||||
## If the bytes begin with a valid #U8 number, return
|
||||
## that number along with the rest of the bytes after it.
|
||||
parseU8 : List U8 -> Result { val : U8, rest : List U8 } [ Expected [ NumU8 ]* List U8 ]*
|
||||
parseI8 : List U8 -> Result { val : I8, rest : List U8 } [ Expected [ NumI8 ]* List U8 ]*
|
||||
parseU16 : List U8, Endi -> Result { val : U16, rest : List U8 } [ Expected [ NumU16 Endi ]* (List U8) ]*
|
||||
parseI16 : List U8, Endi -> Result { val : I16, rest : List U8 } [ Expected [ NumI16 Endi ]* (List U8) ]*
|
||||
parseU32 : List U8, Endi -> Result { val : U32, rest : List U8 } [ Expected [ NumU32 Endi ]* (List U8) ]*
|
||||
parseI32 : List U8, Endi -> Result { val : I32, rest : List U8 } [ Expected [ NumI32 Endi ]* (List U8) ]*
|
||||
parseU64 : List U8, Endi -> Result { val : U64, rest : List U8 } [ Expected [ NumU64 Endi ]* (List U8) ]*
|
||||
parseI64 : List U8, Endi -> Result { val : I64, rest : List U8 } [ Expected [ NumI64 Endi ]* (List U8) ]*
|
||||
parseU128 : List U8, Endi -> Result { val : U128, rest : List U8 } [ Expected [ NumU128 Endi ]* (List U8) ]*
|
||||
parseI128 : List U8, Endi -> Result { val : I128, rest : List U8 } [ Expected [ NumI128 Endi ]* (List U8) ]*
|
||||
parseF64 : List U8, Endi -> Result { val : F64, rest : List U8 } [ Expected [ NumF64 Endi ]* (List U8) ]*
|
||||
parseF32 : List U8, Endi -> Result { val : F32, rest : List U8 } [ Expected [ NumF32 Endi ]* (List U8) ]*
|
||||
parseDec : List U8, Endi -> Result { val : Dec, rest : List U8 } [ Expected [ NumDec Endi ]* (List U8) ]*
|
||||
|
||||
## when Num.parseBytes bytes Big is
|
||||
## Ok { val: f64, rest } -> ...
|
||||
## Err (ExpectedNum (Float Binary64)) -> ...
|
||||
|
|
|
@ -461,29 +461,6 @@ toDec : Str -> Result Dec [ InvalidDec ]*
|
|||
## advanced options, see [parseNum].
|
||||
toNum : Str -> Result (Num a) [ ExpectedNum a ]*
|
||||
|
||||
## If the string begins with a valid #U8 number, return
|
||||
## that number along with the rest of the string after it.
|
||||
parseU8 : Str, NumParseConfig -> Result { val : U8, rest : Str } [ Expected [ NumU8 ]* Str ]*
|
||||
parseI8 : Str, NumParseConfig -> Result { val : I8, rest : Str } [ Expected [ NumI8 ]* Str ]*
|
||||
parseU16 : Str, NumParseConfig -> Result { val : U16, rest : Str } [ Expected [ NumU16 ]* Str ]*
|
||||
parseI16 : Str, NumParseConfig -> Result { val : I16, rest : Str } [ Expected [ NumI16 ]* Str ]*
|
||||
parseU32 : Str, NumParseConfig -> Result { val : U32, rest : Str } [ Expected [ NumU32 ]* Str ]*
|
||||
parseI32 : Str, NumParseConfig -> Result { val : I32, rest : Str } [ Expected [ NumI32 ]* Str ]*
|
||||
parseU64 : Str, NumParseConfig -> Result { val : U64, rest : Str } [ Expected [ NumU64 ]* Str ]*
|
||||
parseI64 : Str, NumParseConfig -> Result { val : I64, rest : Str } [ Expected [ NumI64 ]* Str ]*
|
||||
parseU128 : Str, NumParseConfig -> Result { val : U128, rest : Str } [ Expected [ NumU128 ]* Str ]*
|
||||
parseI128 : Str, NumParseConfig -> Result { val : I128, rest : Str } [ Expected [ NumI128 ]* Str ]*
|
||||
parseDec : Str, NumParseConfig -> Result { val : Dec, rest : Str } [ Expected [ NumDec ]* Str ]*
|
||||
|
||||
## If the string begins with a [finite](Num.isFinite) [F64] number, return
|
||||
## that number along with the rest of the string after it.
|
||||
##
|
||||
## If the string begins with `"NaN"`, `"∞"`, and `"-∞"` (which do not represent
|
||||
## [finite](Num.isFinite) numbers), they will be similarly accepted and
|
||||
## translated into their respective [F64] values.
|
||||
parseF64 : Str, NumParseConfig -> Result { val : F64, rest : Str } [ Expected [ NumF64 ]* Str ]*
|
||||
parseF32 : Str, NumParseConfig -> Result { val : F32, rest : Str } [ Expected [ NumF32 ]* Str ]*
|
||||
|
||||
## If the string begins with an [Int] or a [finite](Num.isFinite) [Frac], return
|
||||
## that number along with the rest of the string after it.
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue