mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
use new def parser for module defs
This commit is contained in:
parent
cf905a13fa
commit
38d925fea6
4 changed files with 51 additions and 24 deletions
|
@ -1,7 +1,6 @@
|
|||
use crate::ast;
|
||||
use crate::module::module_defs;
|
||||
use crate::parser::{Parser, State, SyntaxError};
|
||||
use bumpalo::collections::Vec;
|
||||
// use crate::module::module_defs;
|
||||
use crate::parser::{State, SyntaxError};
|
||||
use bumpalo::Bump;
|
||||
use roc_region::all::Located;
|
||||
|
||||
|
@ -12,18 +11,6 @@ pub fn parse_expr_with<'a>(
|
|||
parse_loc_with(arena, input).map(|loc_expr| loc_expr.value)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn parse_defs_with<'a>(
|
||||
arena: &'a Bump,
|
||||
input: &'a str,
|
||||
) -> Result<Vec<'a, Located<ast::Def<'a>>>, SyntaxError<'a>> {
|
||||
let state = State::new(input.trim().as_bytes());
|
||||
let answer = module_defs().parse(arena, state);
|
||||
answer
|
||||
.map(|(_, loc_expr, _)| loc_expr)
|
||||
.map_err(|(_, fail, _)| fail)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn parse_loc_with<'a>(
|
||||
arena: &'a Bump,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue