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

parser: enum_decl - remove redundant position variable

This commit is contained in:
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

View File

@ -1890,7 +1890,6 @@ fn (mut p Parser) enum_decl() ast.EnumDecl {
}
p.check(.key_enum)
end_pos := p.tok.position()
name_pos := p.tok.position()
enum_name := p.check_name()
if enum_name.len == 1 {
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 {
p.error_with_pos('cannot register enum `$name`, another type with this name exists',
name_pos)
end_pos)
}
return ast.EnumDecl{
name: name