diff options
author | Nadrieril | 2020-10-28 20:38:29 +0000 |
---|---|---|
committer | GitHub | 2020-10-28 20:38:29 +0000 |
commit | 70727acbda68e104f60ae1dbbe95adbcec08a628 (patch) | |
tree | ac3f0782fb90c8f6b03b3d29d1032d06d637e4ee /dhall/src/syntax/text | |
parent | 2b4ba42b7f0a44893f17548f069cec1e60819aa4 (diff) | |
parent | 9e3f68fc54babf24133cf66ae6be7d069ba2c271 (diff) |
Merge pull request #188 from Nadrieril/change-nums
Use u64/i64 instead of usize/isize for the main number types
Diffstat (limited to 'dhall/src/syntax/text')
-rw-r--r-- | dhall/src/syntax/text/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dhall/src/syntax/text/parser.rs b/dhall/src/syntax/text/parser.rs index 377f5e4..37f28e5 100644 --- a/dhall/src/syntax/text/parser.rs +++ b/dhall/src/syntax/text/parser.rs @@ -378,7 +378,7 @@ impl DhallParser { let s = input.as_str().trim(); if s.starts_with("0x") { let without_prefix = s.trim_start_matches("0x"); - usize::from_str_radix(without_prefix, 16) + u64::from_str_radix(without_prefix, 16) .map_err(|e| input.error(format!("{}", e))) } else { s.parse().map_err(|e| input.error(format!("{}", e))) @@ -391,7 +391,7 @@ impl DhallParser { if rest.starts_with("0x") { let without_prefix = sign.to_owned() + rest.trim_start_matches("0x"); - isize::from_str_radix(&without_prefix, 16) + i64::from_str_radix(&without_prefix, 16) .map_err(|e| input.error(format!("{}", e))) } else { s.parse().map_err(|e| input.error(format!("{}", e))) @@ -408,7 +408,7 @@ impl DhallParser { fn variable(input: ParseInput) -> ParseResult<V> { Ok(match_nodes!(input.into_children(); - [label(l), natural_literal(idx)] => V(l, idx), + [label(l), natural_literal(idx)] => V(l, idx as usize), [label(l)] => V(l, 0), )) } |