Skip to content

Commit

Permalink
make safe indexing check for prev expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiori44 committed Nov 4, 2023
1 parent de6199b commit 2eec4cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,11 +1159,12 @@ impl<'a> ParserInfo<'a> {
let mut safe_expr = Expression::with_capacity(expr.len());
safe_expr.append(expr);
let name = self.get_next_internal_var();
self.expr.push_back(VARIABLE {
let line = self.peek(0).line();
self.get_prev_expr().push_back(VARIABLE {
local: true,
names: vec![name.clone()],
values: vec![safe_expr],
line: self.peek(0).line(),
line,
});
expr.push_back(SYMBOL(name.clone()));
expr.push_back(SYMBOL(String::from(" and ")));
Expand Down

0 comments on commit 2eec4cc

Please sign in to comment.