From 91faaafdf9946e28426eb78c15a3aa5d95d8d694 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Fri, 9 Dec 2022 22:37:57 +0000 Subject: [PATCH] fix: replace missed usage of Negate with no ops expression --- src/parser/ast/mod.rs | 4 ---- src/parser/expressions.rs | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/parser/ast/mod.rs b/src/parser/ast/mod.rs index 8039071..0119683 100644 --- a/src/parser/ast/mod.rs +++ b/src/parser/ast/mod.rs @@ -496,10 +496,6 @@ pub enum Expression { YieldFrom { value: Box, }, - Negate { - span: Span, - value: Box, - }, UnaryPlus { span: Span, value: Box, diff --git a/src/parser/expressions.rs b/src/parser/expressions.rs index 39b5262..127c66a 100644 --- a/src/parser/expressions.rs +++ b/src/parser/expressions.rs @@ -1417,10 +1417,7 @@ fn interpolated_string_part(state: &mut State) -> ParseResult let span = state.current.span; state.next(); if let TokenKind::LiteralInteger(i) = &state.current.kind { - let e = Expression::Negate { - span, - value: Box::new(Expression::LiteralInteger { i: i.clone() }), - }; + let e = Expression::ArithmeticOperation(ArithmeticOperation::Negation { span, right: Box::new(Expression::LiteralInteger { i: i.clone() }) }); state.next(); e } else {