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

parser: check (mut f Foo) syntax

This commit is contained in:
yuyi
2020-05-17 19:51:18 +08:00
committed by GitHub
parent b138cadbcb
commit 7f4cf08516
87 changed files with 492 additions and 480 deletions

View File

@ -90,52 +90,52 @@ pub fn new_benchmark_pointer() &Benchmark {
}
}
pub fn (b mut Benchmark) set_total_expected_steps(n int) {
pub fn (mut b Benchmark) set_total_expected_steps(n int) {
b.nexpected_steps = n
}
pub fn (b mut Benchmark) stop() {
pub fn (mut b Benchmark) stop() {
b.bench_timer.stop()
}
pub fn (b mut Benchmark) step() {
pub fn (mut b Benchmark) step() {
b.step_timer.restart()
if !b.no_cstep {
b.cstep++
}
}
pub fn (b mut Benchmark) fail() {
pub fn (mut b Benchmark) fail() {
b.step_timer.stop()
b.ntotal++
b.nfail++
}
pub fn (b mut Benchmark) ok() {
pub fn (mut b Benchmark) ok() {
b.step_timer.stop()
b.ntotal++
b.nok++
}
pub fn (b mut Benchmark) skip() {
pub fn (mut b Benchmark) skip() {
b.step_timer.stop()
b.ntotal++
b.nskip++
}
pub fn (b mut Benchmark) fail_many(n int) {
pub fn (mut b Benchmark) fail_many(n int) {
b.step_timer.stop()
b.ntotal += n
b.nfail += n
}
pub fn (b mut Benchmark) ok_many(n int) {
pub fn (mut b Benchmark) ok_many(n int) {
b.step_timer.stop()
b.ntotal += n
b.nok += n
}
pub fn (b mut Benchmark) neither_fail_nor_ok() {
pub fn (mut b Benchmark) neither_fail_nor_ok() {
b.step_timer.stop()
}
@ -145,7 +145,7 @@ pub fn start() Benchmark {
return b
}
pub fn (b mut Benchmark) measure(label string) i64 {
pub fn (mut b Benchmark) measure(label string) i64 {
b.ok()
res := b.step_timer.elapsed().microseconds()
println(b.step_message_with_label(BSPENT, 'in $label'))