git.delta.rocks / jrsonnet / refs/commits / a75f77f8f37a

difftreelog

feat(evaluator) utility methods for bindings

Лач2020-06-27parent: #2cabc72.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
116 ..Default::default()116 ..Default::default()
117 }))117 }))
118 }118 }
119 pub fn evaluate_file_to_json(
120 &self,
121 path: &PathBuf,
122 ) -> std::result::Result<Rc<str>, LocError> {
123 self.import_file(&PathBuf::new(), &path).and_then(|v|v.into_json(4))
124 }
119 pub fn add_file(125 pub fn add_file(
120 &self,126 &self,
121 name: Rc<PathBuf>,127 name: Rc<PathBuf>,
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
52 value_cache: RefCell::new(HashMap::new()),52 value_cache: RefCell::new(HashMap::new()),
53 }))53 }))
54 }54 }
55 pub fn new_empty() -> ObjValue {
56 Self::new(None, Rc::new(BTreeMap::new()))
57 }
55 pub fn with_super(&self, super_obj: ObjValue) -> ObjValue {58 pub fn with_super(&self, super_obj: ObjValue) -> ObjValue {
56 match &self.0.super_obj {59 match &self.0.super_obj {
57 None => ObjValue::new(Some(super_obj), self.0.this_entries.clone()),60 None => ObjValue::new(Some(super_obj), self.0.this_entries.clone()),