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

parser: use single scope for fn args/body

This commit is contained in:
joe-conigliaro 2020-04-22 21:15:38 +10:00
parent 80a4fbf0be
commit de182d5809
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1

View File

@ -208,7 +208,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
mut stmts := []ast.Stmt
no_body := p.tok.kind != .lcbr
if p.tok.kind == .lcbr {
stmts = p.parse_block()
stmts = p.parse_block_no_scope()
}
p.close_scope()
p.attr = ''
@ -253,7 +253,7 @@ fn (mut p Parser) anon_fn() ast.AnonFn {
mut stmts := []ast.Stmt
no_body := p.tok.kind != .lcbr
if p.tok.kind == .lcbr {
stmts = p.parse_block()
stmts = p.parse_block_no_scope()
}
p.close_scope()
func := table.Fn{