Revert "cgen: print bool in struct correctly"

This reverts commit 78440be2b2.
pull/4282/head
Alexander Medvednikov 2020-04-07 12:56:05 +02:00
parent 78440be2b2
commit 890940292b
1 changed files with 0 additions and 4 deletions

View File

@ -2952,8 +2952,6 @@ fn (g mut Gen) gen_str_for_type(sym table.TypeSymbol, styp string) {
g.definitions.write('a.' + field.name) g.definitions.write('a.' + field.name)
if field.typ == table.string_type { if field.typ == table.string_type {
g.definitions.write('.len, a.${field.name}.str') g.definitions.write('.len, a.${field.name}.str')
} else if field.typ == table.bool_type {
g.definitions.write(' == true ? 4 : 5, a.${field.name} == true ? "true" : "false"')
} }
if i < info.fields.len - 1 { if i < info.fields.len - 1 {
g.definitions.write(', ') g.definitions.write(', ')
@ -2965,8 +2963,6 @@ fn (g mut Gen) gen_str_for_type(sym table.TypeSymbol, styp string) {
fn type_to_fmt(typ table.Type) string { fn type_to_fmt(typ table.Type) string {
n := int(typ) n := int(typ)
if n == table.string_type { if n == table.string_type {
return '\'%.*s\''
} else if n == table.bool_type {
return '%.*s' return '%.*s'
} }
return '%d' return '%d'