From f6179404d1a0ca26fea1b2068d49ee476ffe8604 Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Mon, 3 May 2021 15:21:55 +0200 Subject: [PATCH] Remove dependency on test module --- cli/src/repl.rs | 8 +++++--- compiler/parse/src/expr.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/src/repl.rs b/cli/src/repl.rs index 97c2b81955..c0d7e03917 100644 --- a/cli/src/repl.rs +++ b/cli/src/repl.rs @@ -93,10 +93,12 @@ impl Validator for InputValidator { Ok(ValidationResult::Incomplete) } else { let arena = bumpalo::Bump::new(); - match roc_parse::test_helpers::parse_expr_with(&arena, ctx.input()) { + let state = roc_parse::parser::State::new(ctx.input().trim().as_bytes()); + + match roc_parse::expr::parse_loc_expr(0, &arena, state) { // Special case some syntax errors to allow for multi-line inputs - Err(SyntaxError::Expr(EExpr::DefMissingFinalExpr(_, _))) - | Err(SyntaxError::Expr(EExpr::DefMissingFinalExpr2(_, _, _))) => { + Err((_, EExpr::DefMissingFinalExpr(_, _), _)) + | Err((_, EExpr::DefMissingFinalExpr2(_, _, _), _)) => { Ok(ValidationResult::Incomplete) } _ => Ok(ValidationResult::Valid(None)), diff --git a/compiler/parse/src/expr.rs b/compiler/parse/src/expr.rs index e572dd88df..5483d2c278 100644 --- a/compiler/parse/src/expr.rs +++ b/compiler/parse/src/expr.rs @@ -1360,7 +1360,7 @@ fn parse_expr_end<'a>( } } -fn parse_loc_expr<'a>( +pub fn parse_loc_expr<'a>( min_indent: u16, arena: &'a Bump, state: State<'a>,