From dc7c384b49a7741f3931c2568d5030454253155f Mon Sep 17 00:00:00 2001 From: Folkert Date: Thu, 18 Mar 2021 14:52:37 +0100 Subject: [PATCH] expose less --- compiler/parse/src/expr.rs | 15 +-------------- compiler/parse/tests/test_parse.rs | 1 + editor/src/lang/expr.rs | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/compiler/parse/src/expr.rs b/compiler/parse/src/expr.rs index c3750e9654..57f8e505ff 100644 --- a/compiler/parse/src/expr.rs +++ b/compiler/parse/src/expr.rs @@ -5,7 +5,7 @@ use crate::keyword; use crate::parser::{ self, backtrackable, optional, sep_by1, sep_by1_e, specialize, specialize_ref, then, trailing_sep_by0, word1, word2, EExpr, EInParens, ELambda, EPattern, ERecord, EString, Either, - If, List, Number, ParseResult, Parser, State, SyntaxError, Type, When, + If, List, Number, ParseResult, Parser, State, Type, When, }; use crate::pattern::loc_closure_param; use crate::type_annotation; @@ -34,19 +34,6 @@ pub fn test_parse_expr<'a>( } } -// public for testing purposes -pub fn expr<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>, SyntaxError<'a>> { - // Recursive parsers must not directly invoke functions which return (impl Parser), - // as this causes rustc to stack overflow. Thus, parse_expr must be a - // separate function which recurses by calling itself directly. - specialize( - |e, _, _| SyntaxError::Expr(e), - move |arena, state: State<'a>| { - parse_expr_help(min_indent, arena, state).map(|(a, b, c)| (a, b.value, c)) - }, - ) -} - pub fn expr_help<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>, EExpr<'a>> { move |arena, state: State<'a>| { parse_expr_help(min_indent, arena, state).map(|(a, b, c)| (a, b.value, c)) diff --git a/compiler/parse/tests/test_parse.rs b/compiler/parse/tests/test_parse.rs index 3582c97485..d9256de1e3 100644 --- a/compiler/parse/tests/test_parse.rs +++ b/compiler/parse/tests/test_parse.rs @@ -28,6 +28,7 @@ mod test_parse { AppHeader, Effects, ExposesEntry, ImportsEntry, InterfaceHeader, ModuleName, PackageEntry, PackageName, PackageOrPath, PlatformHeader, To, }; + use roc_parse::module::module_defs; use roc_parse::parser::{Parser, State, SyntaxError}; use roc_parse::test_helpers::parse_expr_with; use roc_region::all::{Located, Region}; diff --git a/editor/src/lang/expr.rs b/editor/src/lang/expr.rs index 5f7d60062d..fa81f23ff6 100644 --- a/editor/src/lang/expr.rs +++ b/editor/src/lang/expr.rs @@ -18,7 +18,6 @@ use roc_module::operator::CalledVia; use roc_module::symbol::{IdentIds, ModuleId, ModuleIds, Symbol}; use roc_parse::ast; use roc_parse::ast::StrLiteral; -use roc_parse::expr::expr; use roc_parse::parser::{loc, Parser, State, SyntaxError}; use roc_problem::can::{Problem, RuntimeError}; use roc_region::all::{Located, Region};