diff options
| author | Mike Buland <mike@xagasoft.com> | 2026-06-13 09:26:56 -0700 |
|---|---|---|
| committer | Mike Buland <mike@xagasoft.com> | 2026-06-13 09:26:56 -0700 |
| commit | 038884232b6efbabb414cb011fa0fc4e3b4c8fd6 (patch) | |
| tree | f960400d8733c50eb13d9a04986ed6e896d50542 /src/lib.rs | |
| parent | 6188fa4c32160846908e4ff7654c4ff7bc177797 (diff) | |
| download | crimtag-038884232b6efbabb414cb011fa0fc4e3b4c8fd6.tar.gz crimtag-038884232b6efbabb414cb011fa0fc4e3b4c8fd6.tar.bz2 crimtag-038884232b6efbabb414cb011fa0fc4e3b4c8fd6.tar.xz crimtag-038884232b6efbabb414cb011fa0fc4e3b4c8fd6.zip | |
I did some silly things. This one doesn't build.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -46,7 +46,7 @@ impl View { | |||
| 46 | for output in &self.outputs { | 46 | for output in &self.outputs { |
| 47 | let mut buf = String::new(); | 47 | let mut buf = String::new(); |
| 48 | let sc = StatefulContext::root( input ); | 48 | let sc = StatefulContext::root( input ); |
| 49 | exec( &sc, &output.code, &mut buf )?; | 49 | exec::<T>( &sc, &output.code, &mut buf )?; |
| 50 | out_vars.insert( output.name.clone(), Value::String(buf) ); | 50 | out_vars.insert( output.name.clone(), Value::String(buf) ); |
| 51 | } | 51 | } |
| 52 | Ok(out_vars) | 52 | Ok(out_vars) |
| @@ -201,7 +201,14 @@ fn exec<T: MappedStructure>(input: &StatefulContext<T>, tokens: &Vec<Token>, buf | |||
| 201 | let Value::List(list) = value { | 201 | let Value::List(list) = value { |
| 202 | for rec in &list { | 202 | for rec in &list { |
| 203 | if let Value::Dictionary(d) = rec { | 203 | if let Value::Dictionary(d) = rec { |
| 204 | exec( &input.local(d), code, buf )? | 204 | if matches!(d, Context) && |
| 205 | matches!(input.root, Context) { | ||
| 206 | println!("Matches."); | ||
| 207 | } else { | ||
| 208 | println!("Doesn't match."); | ||
| 209 | |||
| 210 | } | ||
| 211 | exec( &StatefulContext::full(input.root,d), code, buf )? | ||
| 205 | } | 212 | } |
| 206 | } | 213 | } |
| 207 | } | 214 | } |
