fix all gen and cli tests

This commit is contained in:
Folkert 2021-02-02 22:06:11 +01:00
parent e643d1ea3c
commit f6aa77e6a8
4 changed files with 37 additions and 7 deletions

View file

@ -387,7 +387,9 @@ fn spaces<'a>(
);
if any_newlines {
state = state.check_indent(min_indent).map_err(
|(fail, _)| (progress, fail, original_state),
|(fail, _)| {
(progress, fail, original_state.clone())
},
)?;
}

View file

@ -596,10 +596,13 @@ fn body<'a>(min_indent: u16) -> impl Parser<'a, Body<'a>> {
equals_for_def(),
// Spaces after the '=' (at a normal indentation level) and then the expr.
// The expr itself must be indented more than the pattern and '='
space0_before(
loc!(move |arena, state| parse_expr(indented_more, arena, state)),
min_indent,
)
move |a, s| {
space0_before(
loc!(move |arena, state| { parse_expr(indented_more, arena, state) }),
min_indent,
)
.parse(a, s)
}
)
);
result
@ -1540,7 +1543,8 @@ pub fn if_expr<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>> {
),
skip_first!(
parser::keyword(keyword::ELSE, min_indent),
space1_around(
// NOTE changed this from space1_around to space1_before
space1_before(
loc!(move |arena, state| parse_expr(min_indent, arena, state)),
min_indent,
)