mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
WIP
This commit is contained in:
parent
8f5df8b7b8
commit
56f6770804
14 changed files with 723 additions and 323 deletions
|
@ -17,8 +17,8 @@ pub fn parse_header_with<'a>(arena: &'a Bump, input: &'a str) -> Result<ast::Mod
|
|||
let answer = header().parse(arena, state);
|
||||
|
||||
answer
|
||||
.map(|(loc_expr, _)| loc_expr)
|
||||
.map_err(|(fail, _)| fail)
|
||||
.map(|(_, loc_expr, _)| loc_expr)
|
||||
.map_err(|(_, fail, _)| fail)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
@ -29,8 +29,8 @@ pub fn parse_defs_with<'a>(
|
|||
let state = State::new(input.trim().as_bytes(), Attempting::Module);
|
||||
let answer = module_defs().parse(arena, state);
|
||||
answer
|
||||
.map(|(loc_expr, _)| loc_expr)
|
||||
.map_err(|(fail, _)| fail)
|
||||
.map(|(_, loc_expr, _)| loc_expr)
|
||||
.map_err(|(_, fail, _)| fail)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
@ -40,6 +40,6 @@ pub fn parse_loc_with<'a>(arena: &'a Bump, input: &'a str) -> Result<Located<ast
|
|||
let answer = parser.parse(&arena, state);
|
||||
|
||||
answer
|
||||
.map(|(loc_expr, _)| loc_expr)
|
||||
.map_err(|(fail, _)| fail)
|
||||
.map(|(_, loc_expr, _)| loc_expr)
|
||||
.map_err(|(_, fail, _)| fail)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue