Clean up
This commit is contained in:
parent
8348b6ce85
commit
72af839102
@ -10,6 +10,7 @@ data = {
|
||||
for creature in sea_creatures {
|
||||
data.creatures += creature.name
|
||||
data.total_clams += creature.clams
|
||||
|
||||
if creature.type == 'dolphin' {
|
||||
data.dolphin_clams += creature.clams
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tree_sitter::Node;
|
||||
|
||||
use crate::{value, AbstractTree, Error, Result, Value, VariableMap};
|
||||
use crate::{AbstractTree, Error, Result, Value, VariableMap};
|
||||
|
||||
use super::{identifier::Identifier, statement::Statement};
|
||||
|
||||
|
@ -85,8 +85,6 @@ impl<'context, 'code> Evaluator<'context, 'code> {
|
||||
let root_node = cursor.node();
|
||||
let mut prev_result = Ok(Value::Empty);
|
||||
|
||||
println!("{}", root_node.to_sexp());
|
||||
|
||||
for item_node in root_node.children(&mut cursor) {
|
||||
let item = Item::from_syntax_node(self.source, item_node)?;
|
||||
prev_result = item.run(self.source, self.context);
|
||||
|
@ -780,10 +780,7 @@ impl<'de> Visitor<'de> for ValueVisitor {
|
||||
where
|
||||
E: serde::de::Error,
|
||||
{
|
||||
Err(serde::de::Error::invalid_type(
|
||||
serde::de::Unexpected::Option,
|
||||
&self,
|
||||
))
|
||||
Ok(Value::Empty)
|
||||
}
|
||||
|
||||
fn visit_some<D>(self, deserializer: D) -> std::result::Result<Self::Value, D::Error>
|
||||
@ -801,10 +798,7 @@ impl<'de> Visitor<'de> for ValueVisitor {
|
||||
where
|
||||
E: serde::de::Error,
|
||||
{
|
||||
Err(serde::de::Error::invalid_type(
|
||||
serde::de::Unexpected::Unit,
|
||||
&self,
|
||||
))
|
||||
Ok(Value::Empty)
|
||||
}
|
||||
|
||||
fn visit_newtype_struct<D>(self, deserializer: D) -> std::result::Result<Self::Value, D::Error>
|
||||
|
Loading…
Reference in New Issue
Block a user