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

parser: fix a few things in with blank ident

This commit is contained in:
joe-conigliaro 2019-09-26 21:09:59 +10:00 committed by Alexander Medvednikov
parent 0fcdd7db35
commit 157ef46d5a
2 changed files with 4 additions and 2 deletions

View File

@ -70,8 +70,8 @@ fn (p mut Parser) gen_fn_decl(f Fn, typ, str_args string) {
// blank identifer assignment `_ = 111` // blank identifer assignment `_ = 111`
fn (p mut Parser) gen_blank_identifier_assign() { fn (p mut Parser) gen_blank_identifier_assign() {
p.next() p.check_name()
p.check(.assign) p.check_space(.assign)
pos := p.cgen.add_placeholder() pos := p.cgen.add_placeholder()
mut typ := p.bool_expression() mut typ := p.bool_expression()
tmp := p.get_tmp() tmp := p.get_tmp()

View File

@ -34,6 +34,8 @@ fn (p mut Parser) gen_fn_decl(f Fn, typ, _str_args string) {
} }
fn (p mut Parser) gen_blank_identifier_assign() { fn (p mut Parser) gen_blank_identifier_assign() {
p.check_name()
p.check_space(.assign)
typ := p.bool_expression() typ := p.bool_expression()
or_else := p.tok == .key_orelse or_else := p.tok == .key_orelse
//tmp := p.get_tmp() //tmp := p.get_tmp()