2021-04-18 20:33:55 +00:00
|
|
|
use std::ops::Range;
|
|
|
|
|
2021-06-02 20:29:31 +00:00
|
|
|
use crate::brian::InterpretError;
|
|
|
|
|
2021-04-18 20:33:55 +00:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub struct Error {
|
|
|
|
pub kind: ErrorKind,
|
|
|
|
pub position: Range<usize>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub enum ErrorKind {
|
2021-04-26 08:44:42 +00:00
|
|
|
SyntaxError(String),
|
|
|
|
EndOfTokenStream,
|
2021-04-27 09:09:19 +00:00
|
|
|
InvalidIdentifier,
|
2021-05-20 23:18:01 +00:00
|
|
|
UnknownVariable(String),
|
|
|
|
MeloVariable(String),
|
|
|
|
TypeError(String),
|
2021-05-26 02:22:38 +00:00
|
|
|
TopLevelBreak,
|
2021-05-27 15:05:57 +00:00
|
|
|
ArithmeticError,
|
2021-06-02 20:29:31 +00:00
|
|
|
BfInterpretError(InterpretError),
|
2021-04-27 11:48:56 +00:00
|
|
|
}
|