diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2022-08-19 14:47:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-19 14:47:15 +0200 |
| commit | e81700ba2c2c84b14fd62449964ba7efc2d3a20d (patch) | |
| tree | ba535f3c011e0404a1529001e6eccb5597d76511 /src | |
| parent | d8ec8c5c098ae2829e4916d7a33b6dbe7d515df7 (diff) | |
| parent | ab16684ca54d76b20e15e206d12e24d21000a83c (diff) | |
Merge pull request #138 from fabiansperber/add-missing-field_flags
Add '#subtype' field flag for struct members
Diffstat (limited to 'src')
| -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) } |