Skip to content

Commit

Permalink
Parser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Oct 15, 2023
1 parent 0875287 commit d6251ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/grammar/expr/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ where
fn inc_arg_count(&mut self) {
if let Some(x) = self.arg_count.last_mut() {
*x = x.saturating_add(1);
let op_pos = self.operator_stack.len() - 2;
let op_pos = self.operator_stack.len().saturating_sub(2);
match self.operator_stack.get_mut(op_pos) {
Some((Token::Function { num_args, id, .. }, _)) if *id == ID_ARRAY_BUILD => {
*num_args += 1;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub enum RuntimeError {

impl Default for Variable {
fn default() -> Self {
Variable::String(Arc::new(String::new())).clone()
Variable::String(Arc::new(String::new()))
}
}

Expand Down

0 comments on commit d6251ec

Please sign in to comment.