mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
add the cmd/tools/gen_1long_fn.v script too
This commit is contained in:
parent
8eded2e025
commit
46c07a5fac
15
cmd/tools/gen_1long_fn.v
Normal file
15
cmd/tools/gen_1long_fn.v
Normal file
@ -0,0 +1,15 @@
|
||||
import strings
|
||||
import os
|
||||
|
||||
n := os.args[1] or { '1_000_000' }.int()
|
||||
stmt := os.args[2] or { 'a = b + c * d' }
|
||||
|
||||
mut s := strings.new_builder(1000)
|
||||
s.writeln('fn main() {')
|
||||
s.writeln(' mut a,b,c,d := 0,1,2,3')
|
||||
for _ in 0 .. n {
|
||||
s.writeln(' ${stmt}')
|
||||
}
|
||||
s.writeln(' println("a: \${a}")')
|
||||
s.writeln('}')
|
||||
os.write_file('${n}.v', s.str())!
|
Loading…
Reference in New Issue
Block a user