From 8bc3d545ce3b07b9fe9f6ff7c2692e73265af74f Mon Sep 17 00:00:00 2001 From: rzvxa Date: Thu, 7 Mar 2024 20:41:51 +0330 Subject: [PATCH] chore(parser): cleanup. --- crates/fuse-parser/src/parsers/binding.rs | 3 +-- crates/fuse-parser/src/parsers/declarations.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fuse-parser/src/parsers/binding.rs b/crates/fuse-parser/src/parsers/binding.rs index cdc2cc6..57ee03f 100644 --- a/crates/fuse-parser/src/parsers/binding.rs +++ b/crates/fuse-parser/src/parsers/binding.rs @@ -1,6 +1,5 @@ use crate::{lexer::TokenKind, Parser, ParserResult}; -use fuse_ast::{Atom, BindingIdentifier, BindingPattern, BindingPatternKind}; -use fuse_common::Span; +use fuse_ast::{BindingIdentifier, BindingPattern, BindingPatternKind}; impl<'a> Parser<'a> { pub(crate) fn parse_binding(&mut self) -> ParserResult { diff --git a/crates/fuse-parser/src/parsers/declarations.rs b/crates/fuse-parser/src/parsers/declarations.rs index 3b57d08..ed5b213 100644 --- a/crates/fuse-parser/src/parsers/declarations.rs +++ b/crates/fuse-parser/src/parsers/declarations.rs @@ -15,6 +15,7 @@ impl<'a> Parser<'a> { self.consume(); let binding = self.parse_binding()?; + let expression = if let Some(_) = self.consume_if(TokenKind::Eq) { Some(self.parse_expression()?) } else {