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

parser: use actual blank ident for consts

This commit is contained in:
joe-conigliaro 2019-09-28 20:59:54 +10:00 committed by Alexander Medvednikov
parent 6bba4b1be0
commit 0fc9ada0aa

View File

@ -481,6 +481,12 @@ fn (p mut Parser) const_decl() {
p.fgenln('')
p.fmt_inc()
for p.tok == .name {
if p.lit == '_' && p.peek() == .assign {
p.gen_blank_identifier_assign()
p.cgen.consts_init << p.cgen.cur_line.trim_space()
p.cgen.resetln('')
continue
}
// `Age = 20`
mut name := p.check_name()
//if ! (name[0] >= `A` && name[0] <= `Z`) {