diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-10 12:54:41 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-10 12:54:41 +0300 |
| commit | 843242e692280d604b74324ba26ead6158223439 (patch) | |
| tree | e5f2d362b1c728f900d8214bc415752336fa4a94 /compiler/src/ast/error.rs | |
| parent | 1801afdbd0058cc9cc040b977de0d5652d65aab9 (diff) | |
| download | crisp-843242e692280d604b74324ba26ead6158223439.tar.gz crisp-843242e692280d604b74324ba26ead6158223439.zip | |
Remove Float from parser
Dropped to make the language simpler.
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 | } |
