diff options
Diffstat (limited to 'compiler/src/ast/error.rs')
| -rw-r--r-- | compiler/src/ast/error.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/src/ast/error.rs b/compiler/src/ast/error.rs index 8117513..38b3916 100644 --- a/compiler/src/ast/error.rs +++ b/compiler/src/ast/error.rs | |||
| @@ -1,13 +1,8 @@ | |||
| 1 | use std::{ | 1 | use std::{error, fmt, num::ParseIntError, rc::Rc}; |
| 2 | error, fmt, | ||
| 3 | num::{ParseFloatError, ParseIntError}, | ||
| 4 | rc::Rc, | ||
| 5 | }; | ||
| 6 | 2 | ||
| 7 | #[derive(Clone, Debug, PartialEq, Eq)] | 3 | #[derive(Clone, Debug, PartialEq, Eq)] |
| 8 | pub enum Error { | 4 | pub enum Error { |
| 9 | // Number | 5 | // Number |
| 10 | InvalidFloatLiteral(Rc<str>, ParseFloatError), | ||
| 11 | InvalidIntegerLiteral(Rc<str>, ParseIntError), | 6 | InvalidIntegerLiteral(Rc<str>, ParseIntError), |
| 12 | 7 | ||
| 13 | // String | 8 | // String |
| @@ -26,9 +21,6 @@ pub enum Error { | |||
| 26 | impl fmt::Display for Error { | 21 | impl fmt::Display for Error { |
| 27 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 22 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 28 | match self { | 23 | match self { |
| 29 | Error::InvalidFloatLiteral(number, err) => { | ||
| 30 | write!(f, "invalid float literal {number}: {err}") | ||
| 31 | } | ||
| 32 | Error::InvalidIntegerLiteral(number, err) => { | 24 | Error::InvalidIntegerLiteral(number, err) => { |
| 33 | write!(f, "invalid integer literal {number}: {err}") | 25 | write!(f, "invalid integer literal {number}: {err}") |
| 34 | } | 26 | } |
