Introducing new enum syntax

This commit is contained in:
2022-09-17 00:58:08 -04:00
parent 2f26e63354
commit b260d9424a
5 changed files with 117 additions and 70 deletions

View File

@@ -354,24 +354,22 @@ func (section EnumSection) ToString (indent int) (output string) {
"enum ",
section.permission.ToString(), " ",
section.name, ":",
section.what.ToString(indent, true), "\n")
section.what.ToString(indent + 1, true), "\n")
for _, member := range section.members {
output += doIndent(indent + 1, member.name)
output += doIndent(indent + 1, "- ", member.name)
isComplexInitialization :=
member.value.kind == ArgumentKindObjectDefaultValues ||
member.value.kind == ArgumentKindArrayDefaultValues
if member.value.value == nil {
output += "\n"
} else if isComplexInitialization {
if isComplexInitialization {
output += "\n"
output += member.value.ToString(indent + 2, true)
} else {
} else if member.value.kind != ArgumentKindNil {
output += " " + member.value.ToString(0, false)
output += "\n"
}
output += "\n"
}
return
}