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:
parent
6bba4b1be0
commit
0fc9ada0aa
|
@ -481,6 +481,12 @@ fn (p mut Parser) const_decl() {
|
||||||
p.fgenln('')
|
p.fgenln('')
|
||||||
p.fmt_inc()
|
p.fmt_inc()
|
||||||
for p.tok == .name {
|
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`
|
// `Age = 20`
|
||||||
mut name := p.check_name()
|
mut name := p.check_name()
|
||||||
//if ! (name[0] >= `A` && name[0] <= `Z`) {
|
//if ! (name[0] >= `A` && name[0] <= `Z`) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user