diff --git a/fixtures/small/next_yield_actual.rb b/fixtures/small/next_yield_actual.rb new file mode 100644 index 00000000..e67e3cee --- /dev/null +++ b/fixtures/small/next_yield_actual.rb @@ -0,0 +1 @@ +next yield a diff --git a/fixtures/small/next_yield_expected.rb b/fixtures/small/next_yield_expected.rb new file mode 100644 index 00000000..e67e3cee --- /dev/null +++ b/fixtures/small/next_yield_expected.rb @@ -0,0 +1 @@ +next yield a diff --git a/librubyfmt/src/format.rs b/librubyfmt/src/format.rs index b006af2b..7da0aa57 100644 --- a/librubyfmt/src/format.rs +++ b/librubyfmt/src/format.rs @@ -1403,7 +1403,8 @@ pub fn format_next(ps: &mut ParserState, next: Next) { match next.1 { ArgsAddBlockOrExpressionList::ExpressionList(e) => { if !e.is_empty() { - panic!("got non empty next expression list, should be impossible"); + ps.emit_space(); + format_list_like_thing_items(ps, e, true); } } ArgsAddBlockOrExpressionList::ArgsAddBlock(aab) => match aab.2 {