From 977c35eaebb39e6ae33661fc8ac8537adfbeceff Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 19 Jun 2026 08:37:01 -0700 Subject: Tweaking StatefulContext --- src/lib.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b682ddc..95462b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -196,24 +196,15 @@ impl Crimtag { fn exec MappedStructure<'a>>(input: &StatefulContext, tokens: &Vec, buf: &mut String) -> CrimResult<()> { for token in tokens { match token { - Token::Loop(_ident,_code) => { - /* + Token::Loop(ident,code) => { if let Some(value) = input.get_value( &ident ) && - let Value::List(list) = value { - for rec in &list { - if let Value::Dictionary(d) = rec { - if matches!(d, Context) && - matches!(input.root, Context) { - println!("Matches."); - } else { - println!("Doesn't match."); - - } + let MappedValue::List(list) = value { + list.for_each(&|rec: &MappedValue| { + if let MappedValue::Struct(d) = rec { exec( &StatefulContext::root(d), code, buf )? } - } + }); } - */ return Ok(()); } Token::If(ident,code,other) => { -- cgit v1.2.3