mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Revise Def structure
This commit is contained in:
parent
2d11659b57
commit
f738d9db80
6 changed files with 79 additions and 45 deletions
|
@ -177,6 +177,18 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub fn allocated<'a, P, Val>(parser: P) -> impl Parser<'a, &'a Val>
|
||||
where
|
||||
P: Parser<'a, Val>,
|
||||
Val: 'a,
|
||||
{
|
||||
move |arena, state: State<'a>| {
|
||||
let (answer, state) = parser.parse(arena, state)?;
|
||||
|
||||
Ok((&*arena.alloc(answer), state))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn not_followed_by<'a, P, ByParser, By, Val>(parser: P, by: ByParser) -> impl Parser<'a, Val>
|
||||
where
|
||||
ByParser: Parser<'a, By>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue