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

difftreelog

source

crates/jrsonnet-evaluator/src/tla.rs622 Bsourcehistory
1use jrsonnet_interner::IStr;2use jrsonnet_parser::Source;3use rustc_hash::FxHashMap;45use crate::{6	function::{CallLocation, TlaArg},7	in_description_frame, with_state, Result, Val,8};910pub fn apply_tla(args: &FxHashMap<IStr, TlaArg>, val: Val) -> Result<Val> {11	Ok(if let Val::Func(func) = val {12		in_description_frame(13			|| "during TLA call".to_owned(),14			|| {15				func.evaluate(16					with_state(|s| {17						s.create_default_context(Source::new_virtual(18							"<top-level-arg>".into(),19							IStr::empty(),20						))21					}),22					CallLocation::native(),23					args,24					false,25				)26			},27		)?28	} else {29		val30	})31}