difftreelog
feat(evaluator) error cloning
in: master
2 files changed
crates/jsonnet-evaluator/src/error.rsdiffbeforeafterboth1use crate::ValType;2use jsonnet_parser::LocExpr;3use std::path::PathBuf;45#[derive(Debug)]6pub enum Error {7 VariableIsNotDefined(String),8 TypeMismatch(&'static str, Vec<ValType>, ValType),9 NoSuchField(String),1011 UnknownVariable(String),1213 UnknownFunctionParameter(String),14 BindingParameterASecondTime(String),15 TooManyArgsFunctionHas(usize),16 FunctionParameterNotBoundInCall(String),1718 UndefinedExternalVariable(String),1920 FieldMustBeStringGot(ValType),2122 AttemptedIndexAnArrayWithString(String),23 ValueIndexMustBeTypeGot(ValType, ValType, ValType),24 CantIndexInto(ValType),2526 StandaloneSuper,2728 ImportFileNotFound(PathBuf, PathBuf),29 ResolvedFileNotFound(PathBuf),30 ImportBadFileUtf8(PathBuf),31 ImportNotSupported(PathBuf, PathBuf),32 ImportSyntaxError(jsonnet_parser::ParseError),3334 RuntimeError(String),35 StackOverflow,36 FractionalIndex,37 DivisionByZero,38}3940#[derive(Clone, Debug)]41pub struct StackTraceElement(pub LocExpr, pub String);42#[derive(Debug)]43pub struct StackTrace(pub Vec<StackTraceElement>);4445#[derive(Debug)]46pub struct LocError(pub Error, pub StackTrace);47pub type Result<V> = std::result::Result<V, LocError>;1use crate::ValType;2use jsonnet_parser::LocExpr;3use std::path::PathBuf;45#[derive(Debug, Clone)]6pub enum Error {7 VariableIsNotDefined(String),8 TypeMismatch(&'static str, Vec<ValType>, ValType),9 NoSuchField(String),1011 UnknownVariable(String),1213 UnknownFunctionParameter(String),14 BindingParameterASecondTime(String),15 TooManyArgsFunctionHas(usize),16 FunctionParameterNotBoundInCall(String),1718 UndefinedExternalVariable(String),1920 FieldMustBeStringGot(ValType),2122 AttemptedIndexAnArrayWithString(String),23 ValueIndexMustBeTypeGot(ValType, ValType, ValType),24 CantIndexInto(ValType),2526 StandaloneSuper,2728 ImportFileNotFound(PathBuf, PathBuf),29 ResolvedFileNotFound(PathBuf),30 ImportBadFileUtf8(PathBuf),31 ImportNotSupported(PathBuf, PathBuf),32 ImportSyntaxError(jsonnet_parser::ParseError),3334 RuntimeError(String),35 StackOverflow,36 FractionalIndex,37 DivisionByZero,38}3940#[derive(Clone, Debug)]41pub struct StackTraceElement(pub LocExpr, pub String);42#[derive(Debug, Clone)]43pub struct StackTrace(pub Vec<StackTraceElement>);4445#[derive(Debug, Clone)]46pub struct LocError(pub Error, pub StackTrace);47pub type Result<V> = std::result::Result<V, LocError>;crates/jsonnet-evaluator/src/val.rsdiffbeforeafterboth--- a/crates/jsonnet-evaluator/src/val.rs
+++ b/crates/jsonnet-evaluator/src/val.rs
@@ -96,7 +96,7 @@
}
}
-#[derive(Debug)]
+#[derive(Debug, Clone)]
pub enum ValType {
Bool,
Null,