mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
expose less
This commit is contained in:
parent
3b647274dc
commit
dc7c384b49
3 changed files with 2 additions and 15 deletions
|
@ -5,7 +5,7 @@ use crate::keyword;
|
|||
use crate::parser::{
|
||||
self, backtrackable, optional, sep_by1, sep_by1_e, specialize, specialize_ref, then,
|
||||
trailing_sep_by0, word1, word2, EExpr, EInParens, ELambda, EPattern, ERecord, EString, Either,
|
||||
If, List, Number, ParseResult, Parser, State, SyntaxError, Type, When,
|
||||
If, List, Number, ParseResult, Parser, State, Type, When,
|
||||
};
|
||||
use crate::pattern::loc_closure_param;
|
||||
use crate::type_annotation;
|
||||
|
@ -34,19 +34,6 @@ pub fn test_parse_expr<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
// public for testing purposes
|
||||
pub fn expr<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>, SyntaxError<'a>> {
|
||||
// Recursive parsers must not directly invoke functions which return (impl Parser),
|
||||
// as this causes rustc to stack overflow. Thus, parse_expr must be a
|
||||
// separate function which recurses by calling itself directly.
|
||||
specialize(
|
||||
|e, _, _| SyntaxError::Expr(e),
|
||||
move |arena, state: State<'a>| {
|
||||
parse_expr_help(min_indent, arena, state).map(|(a, b, c)| (a, b.value, c))
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pub fn expr_help<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>, EExpr<'a>> {
|
||||
move |arena, state: State<'a>| {
|
||||
parse_expr_help(min_indent, arena, state).map(|(a, b, c)| (a, b.value, c))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue