mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: multiple names error
This commit is contained in:
parent
de272654f1
commit
b21be7f670
5
vlib/v/checker/tests/multi_names_err.out
Normal file
5
vlib/v/checker/tests/multi_names_err.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
vlib/v/checker/tests/multi_names_err.v:2:4: error: unexpected name `a`
|
||||
1 | fn main() {
|
||||
2 | a a a a := 1
|
||||
| ^
|
||||
3 | }
|
3
vlib/v/checker/tests/multi_names_err.vv
Normal file
3
vlib/v/checker/tests/multi_names_err.vv
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
a a a a := 1
|
||||
}
|
|
@ -472,6 +472,8 @@ pub fn (mut p Parser) stmt() ast.Stmt {
|
|||
return ast.GotoLabel{
|
||||
name: name
|
||||
}
|
||||
} else if p.tok.kind == .name && p.peek_tok.kind == .name {
|
||||
p.error_with_pos('unexpected name `$p.peek_tok.lit`', p.peek_tok.position())
|
||||
}
|
||||
epos := p.tok.position()
|
||||
expr := p.expr(0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user