allow alternatives on all branches.

This commit is contained in:
Stoeffel 2020-01-08 12:58:40 +01:00
parent a98113c88d
commit 150b75721c
2 changed files with 23 additions and 4 deletions

View file

@ -904,10 +904,13 @@ pub fn case_branches<'a>(
let branch_parser = and!(
then(
space1_around(loc!(pattern(min_indent)), min_indent),
sep_by1(
char('|'),
space1_around(loc!(pattern(min_indent)), min_indent),
),
move |_arena, state, loc_pattern| {
if state.indent_col == original_indent {
Ok((bumpalo::vec![in arena; loc_pattern ], state))
Ok((loc_pattern, state))
} else {
panic!(
"TODO additional branch didn't have same indentation as first branch"