1use crate::ValType;2use jsonnet_parser::ExprLocation;3use std::{path::PathBuf, rc::Rc};45#[derive(Debug, Clone)]6pub enum Error {7 IntristicNotFound(Rc<str>, Rc<str>),8 IntristicArgumentReorderingIsNotSupportedYet,910 VariableIsNotDefined(String),11 TypeMismatch(&'static str, Vec<ValType>, ValType),12 NoSuchField(Rc<str>),1314 UnknownVariable(Rc<str>),1516 OnlyFunctionsCanBeCalledGot(ValType),17 UnknownFunctionParameter(String),18 BindingParameterASecondTime(Rc<str>),19 TooManyArgsFunctionHas(usize),20 FunctionParameterNotBoundInCall(Rc<str>),2122 UndefinedExternalVariable(Rc<str>),2324 FieldMustBeStringGot(ValType),2526 AttemptedIndexAnArrayWithString(Rc<str>),27 ValueIndexMustBeTypeGot(ValType, ValType, ValType),28 CantIndexInto(ValType),2930 StandaloneSuper,3132 ImportFileNotFound(PathBuf, PathBuf),33 ResolvedFileNotFound(PathBuf),34 ImportBadFileUtf8(PathBuf),35 ImportNotSupported(PathBuf, PathBuf),36 ImportSyntaxError(jsonnet_parser::ParseError),3738 RuntimeError(Rc<str>),39 StackOverflow,40 FractionalIndex,41 DivisionByZero,42}4344#[derive(Clone, Debug)]45pub struct StackTraceElement(pub ExprLocation, pub String);46#[derive(Debug, Clone)]47pub struct StackTrace(pub Vec<StackTraceElement>);4849#[derive(Debug, Clone)]50pub struct LocError(pub Error, pub StackTrace);51pub type Result<V> = std::result::Result<V, LocError>;