mirror of
https://github.com/vlang/v.git
synced 2025-09-13 09:25:45 -04:00
all: change empty comment to newline (#22053)
This commit is contained in:
parent
38e23a76f3
commit
cb58db56ef
@ -24,7 +24,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
bgenerating.measure('generating strings')
|
bgenerating.measure('generating strings')
|
||||||
println('Hashing each of the generated strings...')
|
println('Hashing each of the generated strings...')
|
||||||
//
|
|
||||||
mut bhashing_1 := benchmark.start()
|
mut bhashing_1 := benchmark.start()
|
||||||
start_pos = 0
|
start_pos = 0
|
||||||
checksum = 0
|
checksum = 0
|
||||||
|
@ -195,9 +195,7 @@ fn (mut app App) process_line(text string) ! {
|
|||||||
// Always skip docs
|
// Always skip docs
|
||||||
delete_processed_line_from_log(text)!
|
delete_processed_line_from_log(text)!
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
//
|
|
||||||
else {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
println('process_line: cat=${category} "${text}"')
|
println('process_line: cat=${category} "${text}"')
|
||||||
|
@ -45,7 +45,7 @@ fn main() {
|
|||||||
defer {
|
defer {
|
||||||
elog('fast.html generator end, total: ${total_sw.elapsed().milliseconds():6} ms')
|
elog('fast.html generator end, total: ${total_sw.elapsed().milliseconds():6} ms')
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut ccompiler_path := 'tcc'
|
mut ccompiler_path := 'tcc'
|
||||||
if vdir.contains('/tmp/cirrus-ci-build') {
|
if vdir.contains('/tmp/cirrus-ci-build') {
|
||||||
ccompiler_path = 'clang'
|
ccompiler_path = 'clang'
|
||||||
|
@ -427,7 +427,7 @@ pub fn (mut ts TestSession) test() {
|
|||||||
ts.reporter.worker_threads_start(remaining_files, mut ts)
|
ts.reporter.worker_threads_start(remaining_files, mut ts)
|
||||||
// all the testing happens here:
|
// all the testing happens here:
|
||||||
pool_of_test_runners.work_on_pointers(unsafe { remaining_files.pointers() })
|
pool_of_test_runners.work_on_pointers(unsafe { remaining_files.pointers() })
|
||||||
//
|
|
||||||
ts.benchmark.stop()
|
ts.benchmark.stop()
|
||||||
ts.append_message(.sentinel, '', MessageThreadContext{ flow_id: '-1' }) // send the sentinel
|
ts.append_message(.sentinel, '', MessageThreadContext{ flow_id: '-1' }) // send the sentinel
|
||||||
printing_thread.wait()
|
printing_thread.wait()
|
||||||
|
@ -34,10 +34,10 @@ mut:
|
|||||||
session_stop(message string, mut ts TestSession) // called once per test session, in the main thread, after everything else, suitable for summaries, creating .xml reports, uploads etc.
|
session_stop(message string, mut ts TestSession) // called once per test session, in the main thread, after everything else, suitable for summaries, creating .xml reports, uploads etc.
|
||||||
worker_threads_start(files []string, mut ts TestSession) // called once per test session, in the main thread, right before all the worker threads start
|
worker_threads_start(files []string, mut ts TestSession) // called once per test session, in the main thread, right before all the worker threads start
|
||||||
worker_threads_finish(mut ts TestSession) // called once per test session, in the main thread, right after all the worker threads finish
|
worker_threads_finish(mut ts TestSession) // called once per test session, in the main thread, right after all the worker threads finish
|
||||||
//
|
|
||||||
report(index int, log_msg LogMessage) // called once per each message, that will be shown (ok/fail/skip etc), only in the reporting thread.
|
report(index int, log_msg LogMessage) // called once per each message, that will be shown (ok/fail/skip etc), only in the reporting thread.
|
||||||
report_stop() // called just once after all messages are processed, only in the reporting thread, but before stop_session.
|
report_stop() // called just once after all messages are processed, only in the reporting thread, but before stop_session.
|
||||||
//
|
|
||||||
// TODO: reconsider, whether the next methods, should be kept for all reporters, or just moved inside the normal reporter, to simplify the interface
|
// TODO: reconsider, whether the next methods, should be kept for all reporters, or just moved inside the normal reporter, to simplify the interface
|
||||||
progress(index int, message string)
|
progress(index int, message string)
|
||||||
update_last_line(index int, message string)
|
update_last_line(index int, message string)
|
||||||
|
@ -104,12 +104,12 @@ fn sync_cache() {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
scripting.used_tools_must_exist(['git'])
|
scripting.used_tools_must_exist(['git'])
|
||||||
//
|
|
||||||
// Resetting VEXE here allows for `v run cmd/tools/oldv.v'.
|
// Resetting VEXE here allows for `v run cmd/tools/oldv.v'.
|
||||||
// the parent V would have set VEXE, which later will
|
// the parent V would have set VEXE, which later will
|
||||||
// affect the V's run from the tool itself.
|
// affect the V's run from the tool itself.
|
||||||
os.setenv('VEXE', '', true)
|
os.setenv('VEXE', '', true)
|
||||||
//
|
|
||||||
mut context := Context{}
|
mut context := Context{}
|
||||||
context.vgo.workdir = cache_oldv_folder
|
context.vgo.workdir = cache_oldv_folder
|
||||||
mut fp := flag.new_flag_parser(os.args)
|
mut fp := flag.new_flag_parser(os.args)
|
||||||
|
@ -41,7 +41,7 @@ fn main() {
|
|||||||
To find when a feature was implemented (feature.v should succeed on master):
|
To find when a feature was implemented (feature.v should succeed on master):
|
||||||
./v run cmd/tools/regress.v --old a7019ac --command "! ./v run /abs/path/to/feature.v"')
|
./v run cmd/tools/regress.v --old a7019ac --command "! ./v run /abs/path/to/feature.v"')
|
||||||
fp.skip_executable()
|
fp.skip_executable()
|
||||||
//
|
|
||||||
context.new_commit = fp.string('new', `n`, 'master', 'The new commit, by default: master.')
|
context.new_commit = fp.string('new', `n`, 'master', 'The new commit, by default: master.')
|
||||||
context.old_commit = fp.string('old', `o`, '', 'A known old commit, required (for it, COMMAND should exit with 0).')
|
context.old_commit = fp.string('old', `o`, '', 'A known old commit, required (for it, COMMAND should exit with 0).')
|
||||||
context.command = fp.string('command', `c`, '', 'A command to execute. Should exit with 0 for the *old* commits.')
|
context.command = fp.string('command', `c`, '', 'A command to execute. Should exit with 0 for the *old* commits.')
|
||||||
|
@ -118,7 +118,7 @@ fn main() {
|
|||||||
check_ok('${vexe} test ${ok_fpath}').matches('*OK*a_single_ok_test.v*')
|
check_ok('${vexe} test ${ok_fpath}').matches('*OK*a_single_ok_test.v*')
|
||||||
check_ok('${vexe} test "${tdir}"').matches('*OK*a_single_ok_test.v*')
|
check_ok('${vexe} test "${tdir}"').matches('*OK*a_single_ok_test.v*')
|
||||||
check_ok('${vexe} -stats test "${tdir}"').matches('*OK*a_single_ok_test.v*')
|
check_ok('${vexe} -stats test "${tdir}"').matches('*OK*a_single_ok_test.v*')
|
||||||
//
|
|
||||||
fail_fpath := create_test('a_single_failing_test.v', 'fn test_fail(){ assert 1 == 2 }')!
|
fail_fpath := create_test('a_single_failing_test.v', 'fn test_fail(){ assert 1 == 2 }')!
|
||||||
check_fail('${vexe} ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
|
check_fail('${vexe} ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
|
||||||
check_fail('${vexe} test ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
|
check_fail('${vexe} test ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
|
||||||
@ -129,7 +129,7 @@ fn main() {
|
|||||||
os.chdir(rel_dir)!
|
os.chdir(rel_dir)!
|
||||||
relative_path := '..' + os.path_separator + 'a_single_ok_test.v'
|
relative_path := '..' + os.path_separator + 'a_single_ok_test.v'
|
||||||
check_ok('${vexe} test ${os.quoted_path(relative_path)}').has('OK').has('a_single_ok_test.v')
|
check_ok('${vexe} test ${os.quoted_path(relative_path)}').has('OK').has('a_single_ok_test.v')
|
||||||
//
|
|
||||||
check_assert_continues_works()!
|
check_assert_continues_works()!
|
||||||
println('> all done')
|
println('> all done')
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
|
|||||||
} else {
|
} else {
|
||||||
eprintln('unable to compile V in debug mode: ${vdbg_result.output}\ncommand: ${vdbg_compilation_cmd}\n')
|
eprintln('unable to compile V in debug mode: ${vdbg_result.output}\ncommand: ${vdbg_compilation_cmd}\n')
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut result := os.execute('${os.quoted_path(vexe)} ${verbose_flag} ${os.quoted_path(file_path)}')
|
mut result := os.execute('${os.quoted_path(vexe)} ${verbose_flag} ${os.quoted_path(file_path)}')
|
||||||
defer {
|
defer {
|
||||||
os.rm(vdbg_path) or {
|
os.rm(vdbg_path) or {
|
||||||
|
@ -30,7 +30,7 @@ fn main() {
|
|||||||
tfolder := os.join_path(vroot, 'cmd', 'tools')
|
tfolder := os.join_path(vroot, 'cmd', 'tools')
|
||||||
main_label := 'Building ${folder} ...'
|
main_label := 'Building ${folder} ...'
|
||||||
finish_label := 'building ${folder}'
|
finish_label := 'building ${folder}'
|
||||||
//
|
|
||||||
mut skips := []string{}
|
mut skips := []string{}
|
||||||
for stool in tools_in_subfolders {
|
for stool in tools_in_subfolders {
|
||||||
skips << os.join_path(tfolder, stool).replace('\\', '/')
|
skips << os.join_path(tfolder, stool).replace('\\', '/')
|
||||||
@ -49,7 +49,7 @@ fn main() {
|
|||||||
if session.failed_cmds.len > 0 {
|
if session.failed_cmds.len > 0 {
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut executables := os.ls(session.vtmp_dir)!
|
mut executables := os.ls(session.vtmp_dir)!
|
||||||
executables.sort()
|
executables.sort()
|
||||||
for texe in executables {
|
for texe in executables {
|
||||||
|
@ -169,7 +169,7 @@ mut:
|
|||||||
examples []VCodeExample
|
examples []VCodeExample
|
||||||
current VCodeExample
|
current VCodeExample
|
||||||
state MDFileParserState = .markdown
|
state MDFileParserState = .markdown
|
||||||
//
|
|
||||||
oks int
|
oks int
|
||||||
warnings int
|
warnings int
|
||||||
errors int // compilation errors + formatting errors
|
errors int // compilation errors + formatting errors
|
||||||
|
@ -16,7 +16,7 @@ fn (mut a App) println(s string) {
|
|||||||
|
|
||||||
fn (mut a App) collect_info() {
|
fn (mut a App) collect_info() {
|
||||||
a.line('V full version', version.full_v_version(true))
|
a.line('V full version', version.full_v_version(true))
|
||||||
//
|
|
||||||
mut os_kind := os.user_os()
|
mut os_kind := os.user_os()
|
||||||
mut arch_details := []string{}
|
mut arch_details := []string{}
|
||||||
arch_details << '${runtime.nr_cpus()} cpus'
|
arch_details << '${runtime.nr_cpus()} cpus'
|
||||||
@ -54,7 +54,7 @@ fn (mut a App) collect_info() {
|
|||||||
line: 1
|
line: 1
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut os_details := ''
|
mut os_details := ''
|
||||||
wsl_check := a.cmd(command: 'cat /proc/sys/kernel/osrelease')
|
wsl_check := a.cmd(command: 'cat /proc/sys/kernel/osrelease')
|
||||||
if os_kind == 'linux' {
|
if os_kind == 'linux' {
|
||||||
@ -122,7 +122,7 @@ fn (mut a App) collect_info() {
|
|||||||
a.line('Git vroot status', a.git_info())
|
a.line('Git vroot status', a.git_info())
|
||||||
a.line('.git/config present', os.is_file('.git/config').str())
|
a.line('.git/config present', os.is_file('.git/config').str())
|
||||||
a.println('')
|
a.println('')
|
||||||
//
|
|
||||||
a.line('CC version', a.cmd(command: 'cc --version'))
|
a.line('CC version', a.cmd(command: 'cc --version'))
|
||||||
a.report_tcc_version('thirdparty/tcc')
|
a.report_tcc_version('thirdparty/tcc')
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ fn new_aints(ovals []i64, extreme_mins int, extreme_maxs int) Aints {
|
|||||||
if vals.len > 0 {
|
if vals.len > 0 {
|
||||||
res.average = sum / f64(vals.len)
|
res.average = sum / f64(vals.len)
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut devsum := f64(0.0)
|
mut devsum := f64(0.0)
|
||||||
for i in vals {
|
for i in vals {
|
||||||
x := f64(i) - res.average
|
x := f64(i) - res.average
|
||||||
|
@ -22,7 +22,7 @@ mut:
|
|||||||
is_pin bool // does the repl 'pin' entered source code
|
is_pin bool // does the repl 'pin' entered source code
|
||||||
folder string // the folder in which the repl will write its temporary source files
|
folder string // the folder in which the repl will write its temporary source files
|
||||||
last_output string // the last repl output
|
last_output string // the last repl output
|
||||||
//
|
|
||||||
modules []string // all the import modules
|
modules []string // all the import modules
|
||||||
alias map[string]string // all the alias used in the import
|
alias map[string]string // all the alias used in the import
|
||||||
includes []string // all the #include statements
|
includes []string // all the #include statements
|
||||||
|
@ -20,7 +20,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
vexe_name := os.file_name(vexe)
|
vexe_name := os.file_name(vexe)
|
||||||
short_v_name := vexe_name.all_before('.')
|
short_v_name := vexe_name.all_before('.')
|
||||||
//
|
|
||||||
recompilation.must_be_enabled(vroot, 'Please install V from source, to use `${vexe_name} self` .')
|
recompilation.must_be_enabled(vroot, 'Please install V from source, to use `${vexe_name} self` .')
|
||||||
os.chdir(vroot)!
|
os.chdir(vroot)!
|
||||||
os.setenv('VCOLORS', 'always', true)
|
os.setenv('VCOLORS', 'always', true)
|
||||||
|
@ -464,7 +464,7 @@ fn (mut cmd Command) run() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
mut is_failed := false
|
mut is_failed := false
|
||||||
mut is_failed_expected := false
|
mut is_failed_expected := false
|
||||||
mut is_failed_starts_with := false
|
mut is_failed_starts_with := false
|
||||||
@ -497,10 +497,10 @@ fn (mut cmd Command) run() {
|
|||||||
is_failed_contains = true
|
is_failed_contains = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
run_label := if is_failed { term.failed('FAILED') } else { term_highlight('OK') }
|
run_label := if is_failed { term.failed('FAILED') } else { term_highlight('OK') }
|
||||||
println('> Running: "${cmd.line}" took: ${spent} ms ... ${run_label}')
|
println('> Running: "${cmd.line}" took: ${spent} ms ... ${run_label}')
|
||||||
//
|
|
||||||
if is_failed && is_failed_expected {
|
if is_failed && is_failed_expected {
|
||||||
eprintln('> expected:\n${cmd.expect}')
|
eprintln('> expected:\n${cmd.expect}')
|
||||||
eprintln('> output:\n${cmd.output}')
|
eprintln('> output:\n${cmd.output}')
|
||||||
|
@ -79,7 +79,7 @@ fn v_test_vetting(vargs string) ! {
|
|||||||
}
|
}
|
||||||
vet_session := tsession(vargs, 'vvet', '${os.quoted_path(vexe)} vet', 'vet', expanded_vet_list,
|
vet_session := tsession(vargs, 'vvet', '${os.quoted_path(vexe)} vet', 'vet', expanded_vet_list,
|
||||||
vet_known_exceptions)
|
vet_known_exceptions)
|
||||||
//
|
|
||||||
fmt_cmd, fmt_args := if is_fix {
|
fmt_cmd, fmt_args := if is_fix {
|
||||||
'${os.quoted_path(vexe)} fmt -w', 'fmt -w'
|
'${os.quoted_path(vexe)} fmt -w', 'fmt -w'
|
||||||
} else {
|
} else {
|
||||||
@ -88,7 +88,7 @@ fn v_test_vetting(vargs string) ! {
|
|||||||
vfmt_list := util.find_all_v_files(vfmt_verify_list) or { return }
|
vfmt_list := util.find_all_v_files(vfmt_verify_list) or { return }
|
||||||
exceptions := util.find_all_v_files(vfmt_known_failing_exceptions) or { return }
|
exceptions := util.find_all_v_files(vfmt_known_failing_exceptions) or { return }
|
||||||
verify_session := tsession(vargs, 'vfmt.v', fmt_cmd, fmt_args, vfmt_list, exceptions)
|
verify_session := tsession(vargs, 'vfmt.v', fmt_cmd, fmt_args, vfmt_list, exceptions)
|
||||||
//
|
|
||||||
if vet_session.benchmark.nfail > 0 || verify_session.benchmark.nfail > 0 {
|
if vet_session.benchmark.nfail > 0 || verify_session.benchmark.nfail > 0 {
|
||||||
eprintln('\n')
|
eprintln('\n')
|
||||||
if vet_session.benchmark.nfail > 0 {
|
if vet_session.benchmark.nfail > 0 {
|
||||||
|
@ -3723,7 +3723,7 @@ struct Dog {}
|
|||||||
fn main() {
|
fn main() {
|
||||||
cat := Cat{}
|
cat := Cat{}
|
||||||
assert dump(cat.speak()) == 'meow!'
|
assert dump(cat.speak()) == 'meow!'
|
||||||
//
|
|
||||||
a := Adoptable(cat)
|
a := Adoptable(cat)
|
||||||
assert dump(a.speak()) == 'adopt me!' // call Adoptable's `speak`
|
assert dump(a.speak()) == 'adopt me!' // call Adoptable's `speak`
|
||||||
if a is Cat {
|
if a is Cat {
|
||||||
@ -3732,7 +3732,7 @@ fn main() {
|
|||||||
// Cat `speak`, NOT the Adoptable `speak`:
|
// Cat `speak`, NOT the Adoptable `speak`:
|
||||||
dump(a.speak()) // meow!
|
dump(a.speak()) // meow!
|
||||||
}
|
}
|
||||||
//
|
|
||||||
b := Adoptable(Dog{})
|
b := Adoptable(Dog{})
|
||||||
assert dump(b.speak()) == 'adopt me!' // call Adoptable's `speak`
|
assert dump(b.speak()) == 'adopt me!' // call Adoptable's `speak`
|
||||||
// if b is Dog {
|
// if b is Dog {
|
||||||
@ -7328,7 +7328,7 @@ fn main() {
|
|||||||
nr_users := C.sqlite3_column_int(stmt, 0)
|
nr_users := C.sqlite3_column_int(stmt, 0)
|
||||||
C.sqlite3_finalize(stmt)
|
C.sqlite3_finalize(stmt)
|
||||||
println('There are ${nr_users} users in the database.')
|
println('There are ${nr_users} users in the database.')
|
||||||
//
|
|
||||||
error_msg := &char(0)
|
error_msg := &char(0)
|
||||||
query_all_users := 'select * from users'
|
query_all_users := 'select * from users'
|
||||||
rc := C.sqlite3_exec(db, &char(query_all_users.str), my_callback, voidptr(7), &error_msg)
|
rc := C.sqlite3_exec(db, &char(query_all_users.str), my_callback, voidptr(7), &error_msg)
|
||||||
|
@ -51,7 +51,7 @@ fn test_aead_decrypt_vector_test_51() ! {
|
|||||||
mut ciphertext_msg := []u8{}
|
mut ciphertext_msg := []u8{}
|
||||||
ciphertext_msg << ciphertext
|
ciphertext_msg << ciphertext
|
||||||
ciphertext_msg << expected_tag
|
ciphertext_msg << expected_tag
|
||||||
//
|
|
||||||
ncsize := nonce.len
|
ncsize := nonce.len
|
||||||
mut c := new(key, ncsize)!
|
mut c := new(key, ncsize)!
|
||||||
mut cs := chacha20.new_cipher(key, nonce)!
|
mut cs := chacha20.new_cipher(key, nonce)!
|
||||||
|
@ -16,7 +16,7 @@ enum State {
|
|||||||
simple // default - no special interpretation of tags, *at all*!
|
simple // default - no special interpretation of tags, *at all*!
|
||||||
// That is suitable for the general case of text template interpolation,
|
// That is suitable for the general case of text template interpolation,
|
||||||
// for example for interpolating arbitrary source code (even V source) templates.
|
// for example for interpolating arbitrary source code (even V source) templates.
|
||||||
//
|
|
||||||
html // default, only when the template extension is .html
|
html // default, only when the template extension is .html
|
||||||
css // <style>
|
css // <style>
|
||||||
js // <script>
|
js // <script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user