Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/valadaptive/ntsc-rs into main
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Oct 20, 2024
2 parents 2069a88 + 804bbad commit 76166cb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gui"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
default-run = "ntsc-rs-standalone"
license = "GPL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/gui/about.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions crates/gui/src/expression_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,25 @@ fn eval_expr(lexer: &mut LexerWrapper, min_binding_power: usize) -> Result<f64,
}
Ok(res)
}
Some(Token::Number(value)) => 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))?;
// unary plus does nothing
Ok(inner_value)
}
Some(Token::Minus) => {
lexer.advance()?;
let inner_value = eval_expr(lexer, prefix_binding_power(&Token::Minus))?;
// unary negation
Ok(-inner_value)
}
_ => Err(ParseError::new("Invalid left-hand side")),
}?;

lexer.advance()?;

loop {
let op = match lexer.cur {
Some(token) => match token {
Expand Down

0 comments on commit 76166cb

Please sign in to comment.