mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Test too big/small int literals
This commit is contained in:
parent
dfd1d4bbb4
commit
5e740da48c
3 changed files with 22 additions and 5 deletions
|
@ -111,12 +111,12 @@ where
|
|||
|
||||
match f64_buf.parse::<f64>() {
|
||||
Ok(float) => Expr::Float(float),
|
||||
Err(_) => Expr::MalformedNumber(Problem::TooLarge),
|
||||
Err(_) => Expr::MalformedNumber(Problem::OutsideSupportedRange),
|
||||
}
|
||||
} else {
|
||||
match before_decimal.parse::<i64>() {
|
||||
Ok(int_val) => Expr::Int(int_val),
|
||||
Err(_) => Expr::MalformedNumber(Problem::TooLarge),
|
||||
Err(_) => Expr::MalformedNumber(Problem::OutsideSupportedRange),
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ pub enum Problem {
|
|||
UnsupportedEscapedChar,
|
||||
|
||||
// NUMBER LITERAL
|
||||
TooLarge,
|
||||
OutsideSupportedRange,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue