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:
parent
80a4fbf0be
commit
de182d5809
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user