File tree Expand file tree Collapse file tree
crates/jrsonnet-evaluator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,13 +330,15 @@ impl EvaluationState {
330330
331331 /// If passed value is function then call with set TLA
332332 pub fn with_tla ( & self , val : Val ) -> Result < Val > {
333- Ok ( match val {
334- Val :: Func ( func) => func. evaluate_map (
335- self . create_default_context ( ) ?,
336- & self . settings ( ) . tla_vars ,
337- true ,
338- ) ?,
339- v => v,
333+ self . run_in_state ( || {
334+ Ok ( match val {
335+ Val :: Func ( func) => func. evaluate_map (
336+ self . create_default_context ( ) ?,
337+ & self . settings ( ) . tla_vars ,
338+ true ,
339+ ) ?,
340+ v => v,
341+ } )
340342 } )
341343 }
342344}
@@ -408,7 +410,7 @@ impl EvaluationState {
408410 pub fn add_tla_code ( & self , name : Rc < str > , code : Rc < str > ) -> Result < ( ) > {
409411 let value =
410412 self . evaluate_snippet_raw ( Rc :: new ( PathBuf :: from ( format ! ( "tla_code {}" , name) ) ) , code) ?;
411- self . add_ext_var ( name, value) ;
413+ self . add_tla ( name, value) ;
412414 Ok ( ( ) )
413415 }
414416
You can’t perform that action at this time.
0 commit comments