diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-30 13:18:47 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-30 13:18:47 -0400 |
| commit | 2e27b88c1b9fa8ec9b9f243909f5b793b376f207 (patch) | |
| tree | f70433489c8a1fbf3bae6bf4cce364f6bdf8c9f7 /types.c | |
| parent | 3c0a8f0b899a343f43caf9c95147b2cf77a7b525 (diff) | |
Improved syntax for optionals
Diffstat (limited to 'types.c')
| -rw-r--r-- | types.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -47,9 +47,9 @@ CORD type_to_cord(type_t *t) { } case PointerType: { auto ptr = Match(t, PointerType); - CORD sigil = ptr->is_stack ? "&" : (ptr->is_optional ? "?" : "@"); + CORD sigil = ptr->is_stack ? "&" : "@"; if (ptr->is_readonly) sigil = CORD_cat(sigil, "%"); - return CORD_cat(sigil, type_to_cord(ptr->pointed)); + return CORD_all(sigil, type_to_cord(ptr->pointed), ptr->is_optional ? "?" : CORD_EMPTY); } case EnumType: { auto tagged = Match(t, EnumType); |
