mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
V: fix const bugs and pass const_test.v (#4206)
* fix const bug in v2 * v2: fix const decl * small comment fix
This commit is contained in:
parent
6309e699e5
commit
0e6fe0a4f2
4 changed files with 54 additions and 9 deletions
|
@ -1440,6 +1440,7 @@ fn (p mut Parser) const_decl() ast.ConstDecl {
|
|||
if is_pub {
|
||||
p.next()
|
||||
}
|
||||
pos := p.tok.position()
|
||||
p.check(.key_const)
|
||||
p.check(.lpar)
|
||||
mut fields := []ast.Field
|
||||
|
@ -1463,6 +1464,7 @@ fn (p mut Parser) const_decl() ast.ConstDecl {
|
|||
}
|
||||
p.check(.rpar)
|
||||
return ast.ConstDecl{
|
||||
pos : pos
|
||||
fields: fields
|
||||
exprs: exprs
|
||||
is_pub: is_pub
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue