diff --git a/crates/gui/src/expression_parser.rs b/crates/gui/src/expression_parser.rs index f9a3202..cef2b08 100644 --- a/crates/gui/src/expression_parser.rs +++ b/crates/gui/src/expression_parser.rs @@ -120,7 +120,10 @@ fn eval_expr(lexer: &mut LexerWrapper, min_binding_power: usize) -> Result Ok(value), + Some(Token::Number(value)) => { + lexer.advance()?; + Ok(value) + } Some(Token::Plus) => { lexer.advance()?; let inner_value = eval_expr(lexer, prefix_binding_power(&Token::Plus))?; @@ -136,8 +139,6 @@ fn eval_expr(lexer: &mut LexerWrapper, min_binding_power: usize) -> Result Err(ParseError::new("Invalid left-hand side")), }?; - lexer.advance()?; - loop { let op = match lexer.cur { Some(token) => match token {