parser: fix duplicate enum generation

pull/1755/head
Alexander Medvednikov 2019-08-27 02:48:55 +03:00
parent a43b831965
commit cca85566d3
1 changed files with 1 additions and 1 deletions

View File

@ -686,7 +686,7 @@ fn (p mut Parser) enum_decl(_enum_name string) {
enum_name = p.prepend_mod(enum_name)
}
// Skip empty enums
if enum_name != 'int' {
if enum_name != 'int' && !p.first_pass() {
p.cgen.typedefs << 'typedef int $enum_name;'
}
p.check(.lcbr)