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

all: fix immutable fn args

This commit is contained in:
Alexander Medvednikov
2019-08-06 18:13:04 +02:00
parent 76def48f01
commit 52f473d1c7
5 changed files with 24 additions and 21 deletions

View File

@ -666,6 +666,7 @@ fn (p mut Parser) fn_args(f mut Fn) {
}
f.args << int_arg
}
// `(int, string, int)`
// Just register fn arg types
types_only := p.tok == .mul || (p.peek() == .comma && p.table.known_type(p.lit)) || p.peek() == .rpar// (int, string)
if types_only {
@ -684,12 +685,12 @@ fn (p mut Parser) fn_args(f mut Fn) {
}
}
}
// (a int, b,c string) syntax
// `(a int, b, c string)` syntax
for p.tok != .rpar {
mut names := [
p.check_name()
]
// a,b,c int syntax
// `a,b,c int` syntax
for p.tok == .comma {
p.check(.comma)
p.fspace()