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

parser: ptr++,*(ptr+1)

This commit is contained in:
BigBlack
2019-11-12 04:39:16 +08:00
committed by Alexander Medvednikov
parent bd34524a1c
commit 99169ae4ff
3 changed files with 18 additions and 2 deletions

View File

@ -146,6 +146,19 @@ fn (p mut Parser) name_expr() string {
p.next()
}
if p.tok == .lpar {
p.gen('*'.repeat(deref_nr))
p.gen('(')
p.check(.lpar)
mut temp_type := p.bool_expression()
p.gen(')')
p.check(.rpar)
for _ in 0..deref_nr {
temp_type = temp_type.replace_once('*', '')
}
return temp_type
}
mut name := p.lit
// Raw string (`s := r'hello \n ')
if name == 'r' && p.peek() == .str {