Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mirdaki-ms committed Sep 12, 2023
1 parent aa860b1 commit eba1f53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ where
_ => Err("Return not a value".to_string()),
}
}
Node::ReadBoolean(variable) => read_value(&**variable, Node::Boolean, state),
Node::ReadFloat(variable) => read_value(&**variable, Node::Float, state),
Node::ReadString(variable) => read_value(&**variable, Node::String, state),
Node::ReadBoolean(variable) => read_value(variable, Node::Boolean, state),
Node::ReadFloat(variable) => read_value(variable, Node::Float, state),
Node::ReadString(variable) => read_value(variable, Node::String, state),
Node::String(_) => state.set_current(ast.clone()),
// Taken care of by the assign variable
Node::Unary(_) => unreachable!(),
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fn main() -> Result<(), String> {

match ast {
Ok(t) => interpreter::evaluate(t, io::stdin().lock(), io::stdout()),
Err(e) => Err(format!("Error encountered while parsing: {}", e).to_string()),
Err(e) => Err(format!("Error encountered while parsing: {}", e)),
}
}
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::ast::{BinaryOperation, Node, UnaryOperation};
#[grammar = "grammar.pest"]
struct ForceParser;

pub fn parse(source: &str) -> Result<Vec<Node>, pest::error::Error<Rule>> {
pub fn parse(source: &str) -> Result<Vec<Node>, Box<pest::error::Error<Rule>>> {
let mut ast = vec![];
let pairs = ForceParser::parse(Rule::Program, source)?;
for pair in pairs {
Expand Down

0 comments on commit eba1f53

Please sign in to comment.