1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix duplicate enum generation

This commit is contained in:
Alexander Medvednikov 2019-08-27 02:48:55 +03:00
parent a43b831965
commit cca85566d3

View File

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