diff options
| author | Mel <einebeere@gmail.com> | 2021-12-29 00:48:16 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2021-12-29 00:48:16 +0100 |
| commit | 842e76d57274ea6f8d5929e96f2919fd9cf0afb5 (patch) | |
| tree | 2aae20bdc9e7e60f02e3b89bc1db396eb43a3f61 /src/parse/ast | |
| parent | e621f13a226d297d5368f4c294a8549a93843934 (diff) | |
| download | rabbithole-842e76d57274ea6f8d5929e96f2919fd9cf0afb5.tar.zst rabbithole-842e76d57274ea6f8d5929e96f2919fd9cf0afb5.zip | |
Runtime errors
Diffstat (limited to 'src/parse/ast')
| -rw-r--r-- | src/parse/ast/expression.rs | 4 | ||||
| -rw-r--r-- | src/parse/ast/statement.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/parse/ast/expression.rs b/src/parse/ast/expression.rs index e883aaa..e67150a 100644 --- a/src/parse/ast/expression.rs +++ b/src/parse/ast/expression.rs @@ -52,7 +52,7 @@ impl Display for Expression { impl Expression { pub(crate) fn nested_fmt(&self, f: &mut Formatter<'_>, depth: usize) -> fmt::Result { let pad = " ".repeat(depth); - match self.kind { + match &self.kind { ExpressionKind::Binary { left, op, right } => { writeln!(f, "{}Binary:", pad)?; writeln!(f, "{}- Left:", pad)?; @@ -100,7 +100,7 @@ impl Expression { writeln!(f, "{}Str:", pad)?; for (i, statement) in expr.parts.iter().enumerate() { writeln!(f, "{}- {}:", pad, i)?; - match statement.kind { + match &statement.kind { StrPartKind::Literal(literal) => { writeln!(f, "{}{}", " ".repeat(depth + 1), literal.clone()) } diff --git a/src/parse/ast/statement.rs b/src/parse/ast/statement.rs index 7eb9978..7ed91dc 100644 --- a/src/parse/ast/statement.rs +++ b/src/parse/ast/statement.rs @@ -32,7 +32,7 @@ impl Statement { depth: usize, ) -> std::fmt::Result { let pad = " ".repeat(depth); - match self.kind { + match &self.kind { StatementKind::Expression(expression) => expression.nested_fmt(f, depth)?, StatementKind::Print(expression) => { writeln!(f, "{}Print:", pad)?; |
