diff --git a/components/dada-validate/src/validate/validator.rs b/components/dada-validate/src/validate/validator.rs index 1cdad047..e6c4a69d 100644 --- a/components/dada-validate/src/validate/validator.rs +++ b/components/dada-validate/src/validate/validator.rs @@ -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 { diff --git a/dada_tests/parser/parenthesized_expr.dada b/dada_tests/parser/parenthesized_expr.dada index b1cfa7ad..ff606124 100644 --- a/dada_tests/parser/parenthesized_expr.dada +++ b/dada_tests/parser/parenthesized_expr.dada @@ -3,4 +3,5 @@ async fn main() { print(x).await #! OUTPUT 2 x = (1) print(x).await #! OUTPUT 1 + print((3)).await #! OUTPUT 3 } \ No newline at end of file diff --git a/dada_tests/parser/parenthesized_expr/stdout.ref b/dada_tests/parser/parenthesized_expr/stdout.ref index 5f1d0ece..b52e52d0 100644 --- a/dada_tests/parser/parenthesized_expr/stdout.ref +++ b/dada_tests/parser/parenthesized_expr/stdout.ref @@ -1,2 +1,3 @@ 2 1 +3