Skip to content

Commit

Permalink
remove wrong asserts that fail on print((1))
Browse files Browse the repository at this point in the history
  • Loading branch information
vemoo committed May 10, 2022
1 parent 2b45603 commit d46cd45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
16 changes: 2 additions & 14 deletions components/dada-validate/src/validate/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,12 @@ impl<'me> Validator<'me> {

#[tracing::instrument(level = "debug", skip(self, expr))]
fn give_validated_expr(&mut self, expr: syntax::Expr) -> validated::Expr {
let result = self.validate_expr_in_mode(expr, ExprMode::give());

// Check that the validated expression always has the same
// origin as the expression we started with.
assert_eq!(result.origin_in(self.origins).syntax_expr, expr);

result
self.validate_expr_in_mode(expr, ExprMode::give())
}

#[tracing::instrument(level = "debug", skip(self, expr))]
pub(crate) fn reserve_validated_expr(&mut self, expr: syntax::Expr) -> validated::Expr {
let result = self.validate_expr_in_mode(expr, ExprMode::Reserve);

// Check that the validated expression always has the same
// origin as the expression we started with.
assert_eq!(result.origin_in(self.origins).syntax_expr, expr);

result
self.validate_expr_in_mode(expr, ExprMode::Reserve)
}

fn validate_expr_in_mode(&mut self, expr: syntax::Expr, mode: ExprMode) -> validated::Expr {
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 d46cd45

Please sign in to comment.