mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
basic structure
This commit is contained in:
parent
28cc3348a6
commit
703a8de72f
5 changed files with 362 additions and 18 deletions
|
@ -117,6 +117,22 @@ where
|
|||
)
|
||||
}
|
||||
|
||||
pub fn check_indent<'a, E>(
|
||||
min_indent: u16,
|
||||
indent_problem: fn(Row, Col) -> E,
|
||||
) -> impl Parser<'a, (), E>
|
||||
where
|
||||
E: 'a,
|
||||
{
|
||||
move |_, state: State<'a>| {
|
||||
if state.column > state.indent_col {
|
||||
Ok((NoProgress, (), state))
|
||||
} else {
|
||||
Err((NoProgress, indent_problem(state.line, state.column), state))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn space0_e<'a, E>(
|
||||
min_indent: u16,
|
||||
space_problem: fn(BadInputError, Row, Col) -> E,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue