parser: enum_decl - remove redundant position variable

pull/7264/head
joe-conigliaro 2020-12-11 19:36:39 +11:00
parent 14c4ba6dd9
commit a0d10a6606
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
1 changed files with 1 additions and 2 deletions

View File

@ -1890,7 +1890,6 @@ fn (mut p Parser) enum_decl() ast.EnumDecl {
} }
p.check(.key_enum) p.check(.key_enum)
end_pos := p.tok.position() end_pos := p.tok.position()
name_pos := p.tok.position()
enum_name := p.check_name() enum_name := p.check_name()
if enum_name.len == 1 { if enum_name.len == 1 {
p.error_with_pos('single letter capital names are reserved for generic template types.', p.error_with_pos('single letter capital names are reserved for generic template types.',
@ -1962,7 +1961,7 @@ $pubfn (mut e $enum_name) toggle(flag $enum_name) { unsafe{ *e = int(*e) ^ (
}) })
if idx == -1 { if idx == -1 {
p.error_with_pos('cannot register enum `$name`, another type with this name exists', p.error_with_pos('cannot register enum `$name`, another type with this name exists',
name_pos) end_pos)
} }
return ast.EnumDecl{ return ast.EnumDecl{
name: name name: name