Fix parse level calculation

This commit is contained in:
greg 2018-02-10 17:45:00 -08:00
parent 129af43e69
commit 7a6ace5db1

View File

@ -760,6 +760,7 @@ impl Parser {
next_token: format!("{:?}", next_token), next_token: format!("{:?}", next_token),
level: self.parse_level, level: self.parse_level,
}; };
self.parse_level += 1;
self.parse_record.push(record); self.parse_record.push(record);
let mut lhs = self.prefix_expr()?; let mut lhs = self.prefix_expr()?;
@ -782,6 +783,7 @@ impl Parser {
let operation = Operation(op_str); let operation = Operation(op_str);
lhs = Expression(ExpressionType::BinExp(operation, Box::new(lhs), Box::new(rhs)), None); lhs = Expression(ExpressionType::BinExp(operation, Box::new(lhs), Box::new(rhs)), None);
} }
self.parse_level -= 1;
Ok(lhs) Ok(lhs)
} }