1use crate::ValType;2use jsonnet_parser::LocExpr;34#[derive(Debug)]5pub enum Error {6 VariableIsNotDefined(String),7 TypeMismatch(&'static str, Vec<ValType>, ValType),8 NoSuchField(String),910 UnknownFunctionParameter(String),11 BindingParameterASecondTime(String),12 TooManyArgsFunctionHas(usize),13 FunctionParameterNotBoundInCall(String),1415 UndefinedExternalVariable(String),1617 FieldMustBeStringGot(ValType),1819 RuntimeError(String),20 StackOverflow,21 FractionalIndex,22 DivisionByZero,23}2425#[derive(Clone, Debug)]26pub struct StackTraceElement(pub LocExpr, pub String);27#[derive(Debug)]28pub struct StackTrace(pub Vec<StackTraceElement>);2930#[derive(Debug)]31pub struct LocError(pub Error, pub StackTrace);32pub type Result<V> = std::result::Result<V, LocError>;