Skip to content

Commit

Permalink
fix panic validating print((1))
Browse files Browse the repository at this point in the history
  • Loading branch information
vemoo committed May 7, 2022
1 parent 0793cdf commit e4c5bdc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/dada-validate/src/validate/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ impl<'me> Validator<'me> {
}

syntax::ExprData::Parenthesized(parenthesized_expr) => {
self.validate_expr_in_mode(*parenthesized_expr, mode)
let data = self
.validate_expr_in_mode(*parenthesized_expr, mode)
.data(self.tables)
.clone();
self.add(data, expr)
}

syntax::ExprData::Tuple(element_exprs) => {
Expand Down
1 change: 1 addition & 0 deletions dada_tests/parser/parenthesized_expr.dada
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ async fn main() {
print(x).await #! OUTPUT 2
x = (1)
print(x).await #! OUTPUT 1
print((3)).await #! OUTPUT 3
}
1 change: 1 addition & 0 deletions dada_tests/parser/parenthesized_expr/stdout.ref
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
2
1
3

0 comments on commit e4c5bdc

Please sign in to comment.