aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/ast/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/ast/error.rs')
-rw-r--r--compiler/src/ast/error.rs10
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 @@
1use std::{ 1use 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)]
8pub enum Error { 4pub 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 {
26impl fmt::Display for Error { 21impl 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 }