From 636bd9f149a1df344933e1eaac39cc91ecdca706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 5 Feb 2021 19:36:46 +0100 Subject: Assert -> AssertFailed --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index e73d863..bbdd46b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -17,7 +17,7 @@ pub enum ErrorKind { IndexOutOfBounds(Value, usize, usize), - Assert, + AssertFailed, InvalidProgram, Unreachable, @@ -53,7 +53,7 @@ impl fmt::Display for ErrorKind { .fold(String::new(), |a, v| { format!("{}{:?}, ", a, v) }); write!(f, "{} Cannot apply {:?} to values {}", "Runtime Type Error".bold(), op, values) } - ErrorKind::Assert => { + ErrorKind::AssertFailed => { write!(f, "{}", "Assertion failed".bold()) } ErrorKind::SyntaxError(line, token) => { -- cgit v1.2.1 From 826eb43254ddf8baadcd2ec1dacce594690526db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 5 Feb 2021 20:54:20 +0100 Subject: document public things and change some visibility and rename some variables and good commit yes thank --- src/error.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index bbdd46b..deab89e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,15 +12,18 @@ use crate::tokenizer::Token; #[derive(Debug, Clone)] pub enum ErrorKind { TypeError(Op, Vec), + /// (External function, parameters) ExternTypeMismatch(String, Vec), RuntimeTypeError(Op, Vec), + /// (Indexed value, length, index) IndexOutOfBounds(Value, usize, usize), AssertFailed, InvalidProgram, Unreachable, + /// (line, token) SyntaxError(usize, Token), } -- cgit v1.2.1