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:

committed by
Alexander Medvednikov

parent
bd34524a1c
commit
99169ae4ff
@ -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 {
|
||||
|
Reference in New Issue
Block a user