1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
use smartstring::alias::String; quick_error! { #[derive(Debug)] pub enum Error { File(e: std::io::Error) { from() display("Failed to find file") } Syntax(e: pest_consume::Error<crate::Rule>) { from() display("Syntax Error") } NotImplemented(e: String) { display("Not Implemented {:?}", e) } IndexError { display("This index doesn't exist") } VariableNotFound(e: String) { display("Variable {} not found", e) } FunctionNotFound(e: String) { display("Function {} not found", e) } ReturnOutOfFunction { display("Return was used outside of a function") } BreakOutOfLoop { display("Break was used outside of a loop") } ContinueOutOfLoop { display("Continue was used outside of a loop") } InvalidIndex { display("Invalid index type") } EvalNotBool { display("This expression doesn't evaluate to a boolean") } NoReturnValue { display("This function doesn't return anything") } ImpossibleOperation { display("This is an impossible operation") } } }