Merge branch 'main' into rust-1-76-0-upgrade

This commit is contained in:
Anton-4 2024-04-16 13:33:27 +02:00 committed by GitHub
commit 1a5e065055
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
249 changed files with 7985 additions and 4219 deletions

View file

@ -197,12 +197,17 @@ where
)
}
pub fn check_indent<'a, E>(indent_problem: fn(Position) -> E) -> impl Parser<'a, (), E>
pub fn check_indent<'a, E>(
indent_problem: fn(Position) -> E,
inside_suffixed_statement: bool,
) -> impl Parser<'a, (), E>
where
E: 'a,
{
let extra_spaces = if inside_suffixed_statement { 1 } else { 0 };
move |_, state: State<'a>, min_indent: u32| {
if state.column() >= min_indent {
if state.column() >= (min_indent + extra_spaces) {
Ok((NoProgress, (), state))
} else {
Err((NoProgress, indent_problem(state.pos())))