vfmt: fix `x := *&int(ptr)`
parent
35df792c05
commit
e1eb9c4ff1
|
@ -898,7 +898,7 @@ pub fn (mut f Fmt) expr(node ast.Expr) {
|
|||
}
|
||||
ast.PrefixExpr {
|
||||
f.write(node.op.str())
|
||||
f.expr(node.right)
|
||||
f.prefix_expr_cast_expr( node.right )
|
||||
}
|
||||
ast.RangeExpr {
|
||||
f.expr(node.low)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
fn main() {
|
||||
body := [1, 2, 3]
|
||||
size := *&int(body.data)
|
||||
eprintln('size: $size')
|
||||
}
|
|
@ -8,6 +8,10 @@ import v.table
|
|||
import v.token
|
||||
|
||||
pub fn (mut p Parser) expr(precedence int) ast.Expr {
|
||||
$if trace_parser ? {
|
||||
tok_pos := p.tok.position()
|
||||
eprintln('parsing file: ${p.file_name:-30} | tok.kind: ${p.tok.kind:-10} | tok.lit: ${p.tok.lit:-10} | tok_pos: ${tok_pos.str():-45} | expr($precedence)')
|
||||
}
|
||||
// println('\n\nparser.expr()')
|
||||
mut typ := table.void_type
|
||||
mut node := ast.Expr{}
|
||||
|
|
Loading…
Reference in New Issue