Support both inline and header imports

Load will now convert header imports to inline import defs, so that
we can support both temporarily.
This commit is contained in:
Agus Zubiaga 2024-04-20 18:57:53 -03:00
parent 7a53484479
commit 7ebfc6d06d
No known key found for this signature in database
18 changed files with 235 additions and 121 deletions

View file

@ -2,7 +2,7 @@ use bumpalo::Bump;
use roc_fmt::{annotation::Formattable, module::fmt_module};
use roc_parse::{
ast::{Defs, Expr, Malformed, Module},
module::module_defs,
module::parse_module_defs,
parser::{Parser, SyntaxError},
state::State,
test_helpers::{parse_defs_with, parse_expr_with, parse_header_with},
@ -170,9 +170,7 @@ impl<'a> Input<'a> {
.parse(arena, state.clone(), min_indent)
.map_err(|(_, fail)| SyntaxError::Header(fail))?;
let (_, module_defs, _state) = module_defs()
.parse(arena, state, min_indent)
.map_err(|(_, fail)| fail)?;
let module_defs = parse_module_defs(arena, state, Defs::default()).unwrap();
Ok(Output::Full {
header,