diff options
| author | Fabian Sperber <fabian.sperber@gmx.net> | 2022-08-19 08:24:20 +0200 |
|---|---|---|
| committer | Fabian Sperber <fabian.sperber@gmx.net> | 2022-08-19 08:24:20 +0200 |
| commit | ab16684ca54d76b20e15e206d12e24d21000a83c (patch) | |
| tree | ba535f3c011e0404a1529001e6eccb5597d76511 | |
| parent | d8ec8c5c098ae2829e4916d7a33b6dbe7d515df7 (diff) | |
Add '#subtype' field flag for struct members
| -rw-r--r-- | src/odin/printer/visit.odin | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index ad123b1..49de704 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1605,6 +1605,10 @@ visit_struct_field_list :: proc(p: ^Printer, list: ^ast.Field_List, options := L document = cons(document, text("using"), break_with_no_newline()) } + if .Subtype in field.flags { + document = cons(document, text("#subtype"), break_with_no_newline()) + } + name_options := List_Options{.Add_Comma} if (.Enforce_Newline in options) { @@ -1617,6 +1621,9 @@ visit_struct_field_list :: proc(p: ^Printer, list: ^ast.Field_List, options := L if .Using in field.flags { length += 6 } + if .Subtype in field.flags { + length += 9 + } } align = repeat_space(alignment - length) } |