mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: replace "NB:" with "Note:" (docs/comments)
This commit is contained in:
@ -5,7 +5,7 @@ fn main() {
|
||||
}
|
||||
|
||||
println('
|
||||
NB: `tcc` was not used, so unless you install it yourself, your backend
|
||||
Note: `tcc` was not used, so unless you install it yourself, your backend
|
||||
C compiler will be `cc`, which is usually either `clang`, `gcc` or `msvc`.
|
||||
|
||||
These C compilers, are several times slower at compiling C source code,
|
||||
|
@ -452,7 +452,7 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
|
||||
mut skipped := oskipped.clone()
|
||||
next_file: for f in files {
|
||||
fnormalised := f.replace('\\', '/')
|
||||
// NB: a `testdata` folder, is the preferred name of a folder, containing V code,
|
||||
// Note: a `testdata` folder, is the preferred name of a folder, containing V code,
|
||||
// that you *do not want* the test framework to find incidentally for various reasons,
|
||||
// for example module import tests, or subtests, that are compiled/run by other parent tests
|
||||
// in specific configurations, etc.
|
||||
|
@ -75,7 +75,7 @@ pub fn prepare_vc_source(vcdir string, cdir string, commit string) (string, stri
|
||||
}
|
||||
|
||||
pub fn clone_or_pull(remote_git_url string, local_worktree_path string) {
|
||||
// NB: after clone_or_pull, the current repo branch is === HEAD === master
|
||||
// Note: after clone_or_pull, the current repo branch is === HEAD === master
|
||||
if os.is_dir(local_worktree_path) && os.is_dir(os.join_path_single(local_worktree_path, '.git')) {
|
||||
// Already existing ... Just pulling in this case is faster usually.
|
||||
scripting.run('git -C "$local_worktree_path" checkout --quiet master')
|
||||
|
@ -57,7 +57,7 @@ fn (mut c Context) compile_oldv_if_needed() {
|
||||
c.vgcontext.compile_oldv_if_needed()
|
||||
c.commit_v_hash = c.vgcontext.commit_v__hash
|
||||
if !os.exists(c.vgcontext.vexepath) && c.cmd_to_run.len > 0 {
|
||||
// NB: 125 is a special code, that git bisect understands as 'skip this commit'.
|
||||
// Note: 125 is a special code, that git bisect understands as 'skip this commit'.
|
||||
// it is used to inform git bisect that the current commit leads to a build failure.
|
||||
exit(125)
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ fn (mut context Context) parse_options() ? {
|
||||
mut fp := flag.new_flag_parser(os.args)
|
||||
fp.application(os.file_name(os.executable()))
|
||||
fp.version('0.0.1')
|
||||
fp.description('Repeat command(s) and collect statistics. NB: you have to quote each command, if it contains spaces.')
|
||||
fp.description('Repeat command(s) and collect statistics. Note: you have to quote each command, if it contains spaces.')
|
||||
fp.arguments_description('CMD1 CMD2 ...')
|
||||
fp.skip_executable()
|
||||
fp.limit_free_args_to_at_least(1) ?
|
||||
@ -161,7 +161,7 @@ fn (mut context Context) parse_options() ? {
|
||||
context.warmup = fp.int('warmup', `w`, 2, 'Warmup runs. These are done *only at the start*, and are ignored.')
|
||||
context.show_help = fp.bool('help', `h`, false, 'Show this help screen.')
|
||||
context.use_newline = fp.bool('newline', `n`, false, 'Use \\n, do not overwrite the last line. Produces more output, but easier to diagnose.')
|
||||
context.show_output = fp.bool('output', `O`, false, 'Show command stdout/stderr in the progress indicator for each command. NB: slower, for verbose commands.')
|
||||
context.show_output = fp.bool('output', `O`, false, 'Show command stdout/stderr in the progress indicator for each command. Note: slower, for verbose commands.')
|
||||
context.verbose = fp.bool('verbose', `v`, false, 'Be more verbose.')
|
||||
context.fail_on_maxtime = fp.int('max_time', `m`, max_time, 'Fail with exit code 2, when first cmd takes above M milliseconds (regression).')
|
||||
context.fail_on_regress_percent = fp.int('fail_percent', `f`, max_fail_percent, 'Fail with exit code 3, when first cmd is X% slower than the rest (regression).')
|
||||
|
@ -4,7 +4,7 @@ import os
|
||||
import testing
|
||||
import v.util
|
||||
|
||||
// NB: tools like vdoc are compiled in their own subfolder
|
||||
// Note: tools like vdoc are compiled in their own subfolder
|
||||
// => cmd/tools/vdoc/vdoc.exe
|
||||
// Usually, they have several top level .v files in the subfolder,
|
||||
// that cannot be compiled separately, but instead, the whole folder,
|
||||
|
@ -17,7 +17,7 @@ import vhelp
|
||||
|
||||
struct FormatOptions {
|
||||
is_l bool
|
||||
is_c bool // NB: This refers to the '-c' fmt flag, NOT the C backend
|
||||
is_c bool // Note: This refers to the '-c' fmt flag, NOT the C backend
|
||||
is_w bool
|
||||
is_diff bool
|
||||
is_verbose bool
|
||||
@ -25,7 +25,7 @@ struct FormatOptions {
|
||||
is_debug bool
|
||||
is_noerror bool
|
||||
is_verify bool // exit(1) if the file is not vfmt'ed
|
||||
is_worker bool // true *only* in the worker processes. NB: workers can crash.
|
||||
is_worker bool // true *only* in the worker processes. Note: workers can crash.
|
||||
is_backup bool // make a `file.v.bak` copy *before* overwriting a `file.v` in place with `-w`
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ fn print_welcome_screen() {
|
||||
]
|
||||
help_text := [
|
||||
'Welcome to the V REPL (for help with V itself, type $cmd_exit, then run $cmd_help).',
|
||||
'NB: the REPL is highly experimental. For best V experience, use a text editor, ',
|
||||
'Note: the REPL is highly experimental. For best V experience, use a text editor, ',
|
||||
'save your code in a $file_main file and execute: $cmd_run',
|
||||
version.full_v_version(false),
|
||||
'Use Ctrl-C or ${term.highlight_command('exit')} to exit, or ${term.highlight_command('help')} to see other available commands',
|
||||
@ -387,7 +387,7 @@ fn run_repl(workdir string, vrepl_prefix string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// NB: starting a line with 2 spaces escapes the println heuristic
|
||||
// Note: starting a line with 2 spaces escapes the println heuristic
|
||||
if oline.starts_with(' ') {
|
||||
is_statement = true
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ fn get_all_commands() []Command {
|
||||
}
|
||||
res << Command{
|
||||
line: '$vexe $vargs -progress test-fmt'
|
||||
okmsg: 'All .v files can be processed with `v fmt`. NB: the result may not always be compilable, but `v fmt` should not crash.'
|
||||
okmsg: 'All .v files can be processed with `v fmt`. Note: the result may not always be compilable, but `v fmt` should not crash.'
|
||||
}
|
||||
res << Command{
|
||||
line: '$vexe $vargs -progress test-self'
|
||||
@ -201,7 +201,7 @@ fn get_all_commands() []Command {
|
||||
okmsg: '`v -usecache -cg` works.'
|
||||
rmfile: 'examples/hello_world'
|
||||
}
|
||||
// NB: test that a program that depends on thirdparty libraries with its
|
||||
// Note: test that a program that depends on thirdparty libraries with its
|
||||
// own #flags (tetris depends on gg, which uses sokol) can be compiled
|
||||
// with -usecache:
|
||||
res << Command{
|
||||
|
@ -103,7 +103,7 @@ fn process_cli_args() &Context {
|
||||
fp.description('Test the V parser, by parsing each .v file in each PATH,\n' +
|
||||
'as if it was typed character by character by the user.\n' +
|
||||
'A PATH can be either a folder, or a specific .v file.\n' +
|
||||
'NB: you *have to quote* the PATH, if it contains spaces/punctuation.')
|
||||
'Note: you *have to quote* the PATH, if it contains spaces/punctuation.')
|
||||
fp.arguments_description('PATH1 PATH2 ...')
|
||||
fp.skip_executable()
|
||||
context.is_help = fp.bool('help', `h`, false, 'Show help/usage screen.')
|
||||
|
@ -156,8 +156,8 @@ const (
|
||||
]
|
||||
)
|
||||
|
||||
// NB: musl misses openssl, thus the http tests can not be done there
|
||||
// NB: http_httpbin_test.v: fails with 'cgen error: json: map_string_string is not struct'
|
||||
// Note: musl misses openssl, thus the http tests can not be done there
|
||||
// Note: http_httpbin_test.v: fails with 'cgen error: json: map_string_string is not struct'
|
||||
fn main() {
|
||||
vexe := pref.vexe_path()
|
||||
vroot := os.dir(vexe)
|
||||
|
@ -82,7 +82,7 @@ fn show_usage() {
|
||||
println(' B)')
|
||||
println(' v test file_test.v : run test functions in a given test file.')
|
||||
println(' v -stats test file_test.v : as above, but with more stats.')
|
||||
println(' NB: you can also give many and mixed folder/ file_test.v arguments after `v test` .')
|
||||
println(' Note: you can also give many and mixed folder/ file_test.v arguments after `v test` .')
|
||||
println('')
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ fn (app App) update_from_master() {
|
||||
}
|
||||
|
||||
fn (app App) recompile_v() {
|
||||
// NB: app.vexe is more reliable than just v (which may be a symlink)
|
||||
// Note: app.vexe is more reliable than just v (which may be a symlink)
|
||||
opts := if app.is_prod { '-prod' } else { '' }
|
||||
vself := '${os.quoted_path(app.vexe)} $opts self'
|
||||
app.vprintln('> recompiling v itself with `$vself` ...')
|
||||
|
@ -76,7 +76,7 @@ fn main() {
|
||||
eprintln(vt.e2string(err))
|
||||
}
|
||||
if vfmt_err_count > 0 {
|
||||
eprintln('NB: You can run `v fmt -w file.v` to fix these errors automatically')
|
||||
eprintln('Note: You can run `v fmt -w file.v` to fix these errors automatically')
|
||||
}
|
||||
if vt.errors.len > 0 {
|
||||
exit(1)
|
||||
|
@ -50,7 +50,7 @@ fn get_scan_timeout_seconds() int {
|
||||
// workers, thus it does not leak much.
|
||||
//
|
||||
// b) A worker process, doing the actual monitoring/polling.
|
||||
// NB: *workers are started with the --vwatchworker option*
|
||||
// Note: *workers are started with the --vwatchworker option*
|
||||
//
|
||||
// Worker processes will run for a limited number of iterations, then
|
||||
// they will do exit(255), and then the parent will start a new worker.
|
||||
|
Reference in New Issue
Block a user