diff --git a/compiler/load/src/file.rs b/compiler/load/src/file.rs index dc0dc9ec12..7ae0aa7833 100644 --- a/compiler/load/src/file.rs +++ b/compiler/load/src/file.rs @@ -22,7 +22,7 @@ use roc_mono::ir::{ CapturedSymbols, ExternalSpecializations, PartialProc, PendingSpecialization, Proc, Procs, }; use roc_mono::layout::{Layout, LayoutCache, LayoutProblem}; -use roc_parse::ast::{self, Attempting, StrLiteral, TypeAnnotation}; +use roc_parse::ast::{self, StrLiteral, TypeAnnotation}; use roc_parse::header::{ ExposesEntry, ImportsEntry, PackageEntry, PackageOrPath, PlatformHeader, To, TypedIdent, }; @@ -2304,7 +2304,7 @@ fn load_pkg_config<'a>( Ok(bytes_vec) => { let parse_start = SystemTime::now(); let bytes = arena.alloc(bytes_vec); - let parse_state = parser::State::new_in(arena, bytes, Attempting::Module); + let parse_state = parser::State::new_in(arena, bytes); let parsed = roc_parse::module::header().parse(&arena, parse_state); let parse_header_duration = parse_start.elapsed().unwrap(); @@ -2474,7 +2474,7 @@ fn parse_header<'a>( start_time: SystemTime, ) -> Result<(ModuleId, Msg<'a>), LoadingProblem<'a>> { let parse_start = SystemTime::now(); - let parse_state = parser::State::new_in(arena, src_bytes, Attempting::Module); + let parse_state = parser::State::new_in(arena, src_bytes); let parsed = roc_parse::module::header().parse(&arena, parse_state); let parse_header_duration = parse_start.elapsed().unwrap(); diff --git a/compiler/parse/src/parser.rs b/compiler/parse/src/parser.rs index a16cb3bd9f..1ab906ea70 100644 --- a/compiler/parse/src/parser.rs +++ b/compiler/parse/src/parser.rs @@ -43,7 +43,7 @@ pub enum Either { } impl<'a> State<'a> { - pub fn new_in(arena: &'a Bump, bytes: &'a [u8], _attempting: Attempting) -> State<'a> { + pub fn new_in(arena: &'a Bump, bytes: &'a [u8]) -> State<'a> { State { bytes, line: 0, diff --git a/compiler/parse/src/test_helpers.rs b/compiler/parse/src/test_helpers.rs index ebfb5bb1af..7cfddd8d8c 100644 --- a/compiler/parse/src/test_helpers.rs +++ b/compiler/parse/src/test_helpers.rs @@ -1,4 +1,4 @@ -use crate::ast::{self, Attempting}; +use crate::ast; use crate::blankspace::space0_before; use crate::expr::expr; use crate::module::{header, module_defs}; @@ -18,7 +18,7 @@ pub fn parse_header_with<'a>( arena: &'a Bump, input: &'a str, ) -> Result, SyntaxError<'a>> { - let state = State::new_in(arena, input.trim().as_bytes(), Attempting::Module); + let state = State::new_in(arena, input.trim().as_bytes()); let answer = header().parse(arena, state); answer @@ -31,7 +31,7 @@ pub fn parse_defs_with<'a>( arena: &'a Bump, input: &'a str, ) -> Result>>, SyntaxError<'a>> { - let state = State::new_in(arena, input.trim().as_bytes(), Attempting::Module); + let state = State::new_in(arena, input.trim().as_bytes()); let answer = module_defs().parse(arena, state); answer .map(|(_, loc_expr, _)| loc_expr) @@ -43,7 +43,7 @@ pub fn parse_loc_with<'a>( arena: &'a Bump, input: &'a str, ) -> Result>, SyntaxError<'a>> { - let state = State::new_in(arena, input.trim().as_bytes(), Attempting::Module); + let state = State::new_in(arena, input.trim().as_bytes()); let parser = space0_before(loc(expr(0)), 0); let answer = parser.parse(&arena, state); diff --git a/editor/src/lang/expr.rs b/editor/src/lang/expr.rs index 061fc21495..410009bc2e 100644 --- a/editor/src/lang/expr.rs +++ b/editor/src/lang/expr.rs @@ -16,8 +16,8 @@ use roc_module::ident::ModuleName; use roc_module::low_level::LowLevel; 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::ast::{self, Attempting}; use roc_parse::blankspace::space0_before; use roc_parse::expr::expr; use roc_parse::parser::{loc, Parser, State, SyntaxError}; @@ -235,7 +235,7 @@ pub fn str_to_expr2<'a>( scope: &mut Scope, region: Region, ) -> Result<(Expr2, self::Output), SyntaxError<'a>> { - let state = State::new_in(arena, input.trim().as_bytes(), Attempting::Module); + let state = State::new_in(arena, input.trim().as_bytes()); let parser = space0_before(loc(expr(0)), 0); let parse_res = parser.parse(&arena, state); diff --git a/editor/src/lang/roc_file.rs b/editor/src/lang/roc_file.rs index 676c74048b..f034a1f1b0 100644 --- a/editor/src/lang/roc_file.rs +++ b/editor/src/lang/roc_file.rs @@ -2,7 +2,7 @@ use bumpalo::collections::Vec; use bumpalo::Bump; use roc_fmt::def::fmt_def; use roc_fmt::module::fmt_module; -use roc_parse::ast::{Attempting, Def, Module}; +use roc_parse::ast::{Def, Module}; use roc_parse::module::module_defs; use roc_parse::parser; use roc_parse::parser::{Parser, SyntaxError}; @@ -36,7 +36,7 @@ impl<'a> File<'a> { let allocation = arena.alloc(bytes); - let module_parse_state = parser::State::new_in(arena, allocation, Attempting::Module); + let module_parse_state = parser::State::new_in(arena, allocation); let parsed_module = roc_parse::module::header().parse(&arena, module_parse_state); match parsed_module {