mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
parse toplevel defs into an SOA structure
This commit is contained in:
parent
37fed3fbdb
commit
2ae804790a
13 changed files with 750 additions and 512 deletions
|
@ -1,11 +1,11 @@
|
|||
use crate::ast;
|
||||
use crate::module::module_defs;
|
||||
use crate::ast::Def;
|
||||
use crate::module::module_defs_help;
|
||||
// use crate::module::module_defs;
|
||||
use crate::parser::Parser;
|
||||
use crate::parser::SourceError;
|
||||
use crate::parser::SyntaxError;
|
||||
use crate::state::State;
|
||||
use bumpalo::collections::Vec as BumpVec;
|
||||
use bumpalo::Bump;
|
||||
use roc_region::all::Loc;
|
||||
use roc_region::all::Position;
|
||||
|
@ -35,10 +35,10 @@ pub fn parse_loc_with<'a>(
|
|||
pub fn parse_defs_with<'a>(
|
||||
arena: &'a Bump,
|
||||
input: &'a str,
|
||||
) -> Result<BumpVec<'a, Loc<ast::Def<'a>>>, SyntaxError<'a>> {
|
||||
) -> Result<bumpalo::collections::Vec<'a, Loc<Def<'a>>>, SyntaxError<'a>> {
|
||||
let state = State::new(input.trim().as_bytes());
|
||||
|
||||
match module_defs().parse(arena, state) {
|
||||
match module_defs_help().parse(arena, state) {
|
||||
Ok(tuple) => Ok(tuple.1),
|
||||
Err(tuple) => Err(tuple.1),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue