Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/debug errors #3

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: debug errors
AlexKovalevych committed Sep 27, 2023

Verified

This commit was signed with the committer’s verified signature.
AlexKovalevych Alex Kovalevych
commit 0c8356f4944ead24a59b335a0fc56b5a9bb9c57d
2 changes: 0 additions & 2 deletions crates/core/src/parser/filter_chain.rs
Original file line number Diff line number Diff line change
@@ -24,9 +24,7 @@ impl FilterChain {
/// Process `Value` expression within `runtime`'s stack.
pub fn evaluate<'s>(&'s self, runtime: &'s dyn Runtime) -> Result<ValueCow<'s>> {
// take either the provided value or the value from the provided variable
println!("before filter chain eval: {:#?}", self.entry);
let mut entry = self.entry.evaluate(runtime)?;
println!("after filter chain eval: {:#?}", entry);

// apply all specified filters
for filter in &self.filters {
6 changes: 1 addition & 5 deletions crates/core/src/runtime/runtime.rs
Original file line number Diff line number Diff line change
@@ -242,12 +242,8 @@ impl<'g> Runtime for RuntimeCore<'g> {
None
}

fn get(&self, path: &[ScalarCow<'_>]) -> Result<ValueCow<'_>> {
fn get(&self, _path: &[ScalarCow<'_>]) -> Result<ValueCow<'_>> {
Ok(ValueCow::Owned(Value::Nil))
// let key = path.first().cloned().unwrap_or_else(|| Scalar::new("nil"));
// Error::with_msg("Unknown variable")
// .context("requested variable", key.to_kstr())
// .into_err()
}

fn set_global(
1 change: 0 additions & 1 deletion crates/core/src/runtime/template.rs
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ impl Template {
impl Renderable for Template {
fn render_to(&self, writer: &mut dyn Write, runtime: &dyn Runtime) -> Result<()> {
for el in &self.elements {
println!("Element {:#?}", el);
el.render_to(writer, runtime)?;

// Did the last element we processed set an interrupt? If so, we
1 change: 0 additions & 1 deletion crates/core/src/runtime/variable.rs
Original file line number Diff line number Diff line change
@@ -63,7 +63,6 @@ impl Variable {
})?;
path.push(s);
}
println!("path: {:#?}", path);
Ok(path)
}
}