diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-04-28 16:51:21 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-04-28 16:51:21 +0200 |
| commit | 49a63471d91120a23ec86f1621e99155d1be55c2 (patch) | |
| tree | 3dfafeb0653c094d79b9e780b1dbfd38fa0b206b /tools | |
| parent | 0cb994a3b520b8800fa2dbe7e3b279f9496b6f59 (diff) | |
Fix issues with space in { on comp literals without types.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/odinfmt/tests/.snapshots/returns.odin | 8 | ||||
| -rw-r--r-- | tools/odinfmt/tests/returns.odin | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tools/odinfmt/tests/.snapshots/returns.odin b/tools/odinfmt/tests/.snapshots/returns.odin index ddd8fef..577d5d5 100644 --- a/tools/odinfmt/tests/.snapshots/returns.odin +++ b/tools/odinfmt/tests/.snapshots/returns.odin @@ -42,3 +42,11 @@ return_with_call_expression_in_the_end :: proc() { cons(text(p.indentation), line_suffix(comment.text)), ) } + +return_with_comp_lit_expression_in_the_end :: proc() { + return { + alloc_fn = allocator_alloc_func, + free_fn = allocator_free_func, + user_data = cast(rawptr)context_ptr, + } +} diff --git a/tools/odinfmt/tests/returns.odin b/tools/odinfmt/tests/returns.odin index fea7c2d..58c562f 100644 --- a/tools/odinfmt/tests/returns.odin +++ b/tools/odinfmt/tests/returns.odin @@ -1,4 +1,4 @@ -package odinfmt_test + package odinfmt_test return_with_paren_1 :: proc() { return( @@ -34,5 +34,13 @@ return_with_call_expression_in_the_end :: proc() { return newlines_before_comment, cons_with_nopl(document, cons(text(p.indentation), line_suffix(comment.text))) } +return_with_comp_lit_expression_in_the_end :: proc() { + return { + alloc_fn = allocator_alloc_func, + free_fn = allocator_free_func, + user_data = cast(rawptr)context_ptr, + } +} + |