v: support dump(expr) (#9160)

This commit is contained in:
Delyan Angelov 2021-03-06 19:09:28 +02:00 committed by GitHub
parent 747507dd1d
commit 849cde245c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 219 additions and 53 deletions

10
examples/dump_factorial.v Normal file
View file

@ -0,0 +1,10 @@
fn factorial(n u32) u32 {
if dump(n <= 1) {
return dump(1)
}
return dump(n * factorial(n - 1))
}
fn main() {
println(factorial(5))
}