Skip to content

Commit

Permalink
fix expression test
Browse files Browse the repository at this point in the history
  • Loading branch information
andogq committed Aug 20, 2024
1 parent f92a41e commit ec65544
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stage/parse/expression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ impl Precedence {
fn parse_prefix(compiler: &mut Compiler, tokens: &mut Lexer<'_>) -> Result<Expression, ParseError> {
match tokens.peek_token().unwrap().clone() {
Token::Integer(_) => Ok(Expression::Integer(parse_integer(compiler, tokens)?)),
Token::Ident(_) => match tokens.double_peek_token().unwrap() {
Token::Eq => Ok(Expression::Assign(parse_assign(compiler, tokens)?)),
Token::AddAssign | Token::MinusAssign => {
Token::Ident(_) => match tokens.double_peek_token() {
Some(Token::Eq) => Ok(Expression::Assign(parse_assign(compiler, tokens)?)),
Some(Token::AddAssign | Token::MinusAssign) => {
Ok(Expression::Assign(parse_op_assign(compiler, tokens)?))
}
_ => Ok(Expression::Ident(parse_ident(compiler, tokens)?)),
Expand Down

0 comments on commit ec65544

Please sign in to comment.