Initial implementation combining owned_walk_path and walk_path. Works everywhere except one spot.

This commit is contained in:
Tom Alexander
2020-05-24 14:56:09 -04:00
parent a58b605e59
commit 4790ac77d6
3 changed files with 85 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ use crate::parser::KVPair;
use crate::parser::{Filter, OwnedLiteral, RValue};
use crate::renderer::context_element::CompareContextElement;
use crate::renderer::context_element::ContextElement;
use crate::renderer::walking::owned_walk_path;
use crate::renderer::walking::walk_path_combined;
use crate::renderer::Loopable;
use crate::renderer::RenderError;
use crate::renderer::Renderable;
@@ -89,7 +89,7 @@ impl Walkable for ParametersContext {
fn walk(&self, segment: &str) -> Result<&dyn ContextElement, WalkError> {
let rval = self.params.get(segment).ok_or(WalkError::CantWalk)?;
match rval {
OwnedRValue::RVPath(path) => owned_walk_path(&self.breadcrumbs, &path.keys),
OwnedRValue::RVPath(path) => walk_path_combined(&self.breadcrumbs, &path.keys),
OwnedRValue::RVLiteral(literal) => Ok(literal),
}
}