Allow parsing when cases with python-like indentation

This commit is contained in:
Joshua Warner 2022-10-16 15:10:05 -07:00
parent d6885bde23
commit e39a385f5f
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 128 additions and 1 deletions

View file

@ -2080,7 +2080,7 @@ mod when {
/// Parsing when with indentation.
fn when_with_indent<'a>() -> impl Parser<'a, u32, EWhen<'a>> {
move |arena, state: State<'a>| {
let min_indent = state.column();
let min_indent = state.line_indent() + 1;
parser::keyword_e(keyword::WHEN, EWhen::When)
.parse(arena, state)
.map(|(progress, (), state)| (progress, min_indent, state))