diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-31 09:50:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-31 09:50:42 -0400 |
| commit | 8ee9db53bf77e676afa6ebf9c5a1b5bc6504c627 (patch) | |
| tree | 175acff0c2af766d14ae267e1c1469753a2d2129 /src | |
| parent | a28e812c9150f4f8ba67c54b18b82b16083be3aa (diff) | |
| parent | 03de2974d8e03e3b24b8dd57708fa33a8de821d0 (diff) | |
Merge pull request #952 from BradLewis/fix/single-line-switch-procs
Inline single stmt case now works with proc calls, not just assignments
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 10690dd..2cd5356 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1085,9 +1085,8 @@ visit_stmt :: proc( if count := len(v.body); count > 0 { set_source_position(p, v.body[0].pos) - fst_stmt, is_assign := v.body[0].derived_stmt.(^Assign_Stmt) - if is_assign && count == 1 && p.config.inline_single_stmt_case { - document = cons_with_opl(document, nest(visit_stmt(p, fst_stmt))) + if count == 1 && p.config.inline_single_stmt_case { + document = cons_with_opl(document, nest(visit_stmt(p, v.body[0]))) } else { document = cons(document, nest(cons(newline(1), visit_block_stmts(p, v.body)))) } |