parser: use actual blank ident for consts

pull/2148/head
joe-conigliaro 2019-09-28 20:59:54 +10:00 committed by Alexander Medvednikov
parent 6bba4b1be0
commit 0fc9ada0aa
1 changed files with 6 additions and 0 deletions

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`) {