diff options
| author | Mike Buland <mike@xagasoft.com> | 2026-06-19 08:37:01 -0700 |
|---|---|---|
| committer | Mike Buland <mike@xagasoft.com> | 2026-06-19 08:37:01 -0700 |
| commit | 977c35eaebb39e6ae33661fc8ac8537adfbeceff (patch) | |
| tree | 020d6c03651651e0e02580cf032146e7066a96b1 /src/lib.rs | |
| parent | a7ae82db8aef8b327e893a4619346ad59b2ed895 (diff) | |
| download | crimtag-977c35eaebb39e6ae33661fc8ac8537adfbeceff.tar.gz crimtag-977c35eaebb39e6ae33661fc8ac8537adfbeceff.tar.bz2 crimtag-977c35eaebb39e6ae33661fc8ac8537adfbeceff.tar.xz crimtag-977c35eaebb39e6ae33661fc8ac8537adfbeceff.zip | |
Tweaking StatefulContext
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 19 |
1 files changed, 5 insertions, 14 deletions
| @@ -196,24 +196,15 @@ impl Crimtag { | |||
| 196 | fn exec<T: for<'a> MappedStructure<'a>>(input: &StatefulContext<T>, tokens: &Vec<Token>, buf: &mut String) -> CrimResult<()> { | 196 | fn exec<T: for<'a> MappedStructure<'a>>(input: &StatefulContext<T>, tokens: &Vec<Token>, buf: &mut String) -> CrimResult<()> { |
| 197 | for token in tokens { | 197 | for token in tokens { |
| 198 | match token { | 198 | match token { |
| 199 | Token::Loop(_ident,_code) => { | 199 | Token::Loop(ident,code) => { |
| 200 | /* | ||
| 201 | if let Some(value) = input.get_value( &ident ) && | 200 | if let Some(value) = input.get_value( &ident ) && |
| 202 | let Value::List(list) = value { | 201 | let MappedValue::List(list) = value { |
| 203 | for rec in &list { | 202 | list.for_each(&|rec: &MappedValue| { |
| 204 | if let Value::Dictionary(d) = rec { | 203 | if let MappedValue::Struct(d) = rec { |
| 205 | if matches!(d, Context) && | ||
| 206 | matches!(input.root, Context) { | ||
| 207 | println!("Matches."); | ||
| 208 | } else { | ||
| 209 | println!("Doesn't match."); | ||
| 210 | |||
| 211 | } | ||
| 212 | exec( &StatefulContext::root(d), code, buf )? | 204 | exec( &StatefulContext::root(d), code, buf )? |
| 213 | } | 205 | } |
| 214 | } | 206 | }); |
| 215 | } | 207 | } |
| 216 | */ | ||
| 217 | return Ok(()); | 208 | return Ok(()); |
| 218 | } | 209 | } |
| 219 | Token::If(ident,code,other) => { | 210 | Token::If(ident,code,other) => { |
