Switch the renderer over to using the new is_truthy value and add the injection of $idx and $len into the context tree.
This commit is contained in:
@@ -6,6 +6,7 @@ use crate::renderer::Renderable;
|
||||
use crate::renderer::Truthiness;
|
||||
use crate::renderer::WalkError;
|
||||
use crate::{parser::Filter, parser::OwnedLiteral, renderer::Walkable};
|
||||
use std::convert::TryInto;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
@@ -21,10 +22,11 @@ pub struct IterationContext {
|
||||
}
|
||||
|
||||
impl IterationContext {
|
||||
pub fn new(idx: u64, len: u64) -> Self {
|
||||
pub fn new(idx: usize, len: usize) -> Self {
|
||||
// TODO: it would be nice to handle usize vs u64 better
|
||||
IterationContext {
|
||||
idx: OwnedLiteral::LPositiveInteger(idx),
|
||||
len: OwnedLiteral::LPositiveInteger(len),
|
||||
idx: OwnedLiteral::LPositiveInteger(idx.try_into().unwrap()),
|
||||
len: OwnedLiteral::LPositiveInteger(len.try_into().unwrap()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user