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

parser: parse type - fix multiple &

This commit is contained in:
joe-conigliaro
2020-03-29 01:15:10 +11:00
parent 831be43740
commit 837bffd03a
2 changed files with 12 additions and 7 deletions

View File

@@ -94,9 +94,14 @@ pub fn (p mut Parser) parse_type() table.Type {
}
// &Type
mut nr_muls := 0
for p.tok.kind == .amp {
p.check(.amp)
nr_muls++
for p.tok.kind in [.and, .amp] {
if p.tok.kind == .and {
nr_muls+=2
}
else {
nr_muls++
}
p.next()
}
if p.tok.kind == .key_mut {
nr_muls++