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

fmt: process TypeOf node

This commit is contained in:
Alexey 2020-04-03 12:59:53 +03:00 committed by GitHub
parent 87a185ea9c
commit 4cde6c0865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -592,6 +592,11 @@ fn (f mut Fmt) expr(node ast.Expr) {
f.write('}')
}
}
ast.TypeOf {
f.write('typeof(')
f.expr(it.expr)
f.write(')')
}
else {
eprintln('fmt expr: unhandled node ' + typeof(node))
}

View File

@ -0,0 +1,3 @@
fn test_typeof() {
println(typeof(x))
}