From e419faf7464e3a6217c139ebfa3b432e0bbef001 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 2 Dec 2022 12:51:00 +0200 Subject: [PATCH] all: fix `dependant`->`dependent` typos, cleanup comments --- cmd/tools/vcomplete.v | 4 ++-- examples/sokol/03_march_tracing_glsl/rt_glsl.glsl | 2 +- examples/sokol/04_multi_shader_glsl/rt_glsl_march.glsl | 2 +- vlib/os/os_windows.c.v | 1 - vlib/os/process_nix.c.v | 2 +- vlib/time/parse.js.v | 2 +- vlib/v/fmt/fmt.v | 2 +- vlib/v/gen/c/cgen.v | 8 ++++---- vlib/v/gen/golang/golang.v | 6 +----- vlib/v/gen/golang/struct.v | 7 ------- vlib/v/util/errors.v | 5 +++-- 11 files changed, 15 insertions(+), 26 deletions(-) diff --git a/cmd/tools/vcomplete.v b/cmd/tools/vcomplete.v index 79eb4ccf6..27535e9ad 100644 --- a/cmd/tools/vcomplete.v +++ b/cmd/tools/vcomplete.v @@ -356,8 +356,8 @@ fn auto_complete(args []string) { exit(0) } -// append_separator_if_dir is a utility function.that returns the input `path` appended an -// OS dependant path separator if the `path` is a directory. +// append_separator_if_dir returns the input `path` with an appended +// `/` or `\`, depending on the platform, when `path` is a directory. fn append_separator_if_dir(path string) string { if os.is_dir(path) && !path.ends_with(os.path_separator) { return path + os.path_separator diff --git a/examples/sokol/03_march_tracing_glsl/rt_glsl.glsl b/examples/sokol/03_march_tracing_glsl/rt_glsl.glsl index 3490873ea..8486dc7f9 100644 --- a/examples/sokol/03_march_tracing_glsl/rt_glsl.glsl +++ b/examples/sokol/03_march_tracing_glsl/rt_glsl.glsl @@ -168,7 +168,7 @@ float sdRoundCone(vec3 p, vec3 a, vec3 b, float r1, float r2) float a2 = l2 - rr*rr; float il2 = 1.0/l2; - // sampling dependant computations + // sampling dependent computations vec3 pa = p - a; float y = dot(pa,ba); float z = y - l2; diff --git a/examples/sokol/04_multi_shader_glsl/rt_glsl_march.glsl b/examples/sokol/04_multi_shader_glsl/rt_glsl_march.glsl index ed76e2514..a19cae0ce 100644 --- a/examples/sokol/04_multi_shader_glsl/rt_glsl_march.glsl +++ b/examples/sokol/04_multi_shader_glsl/rt_glsl_march.glsl @@ -168,7 +168,7 @@ float sdRoundCone(vec3 p, vec3 a, vec3 b, float r1, float r2) float a2 = l2 - rr*rr; float il2 = 1.0/l2; - // sampling dependant computations + // sampling dependent computations vec3 pa = p - a; float y = dot(pa,ba); float z = y - l2; diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index 8dfbd5aa6..766e38c92 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -169,7 +169,6 @@ pub fn ls(path string) ![]string { if !is_dir(path) { return error('ls() couldnt open dir "${path}": directory does not exist') } - // NOTE: Should eventually have path struct & os dependant path seperator (eg os.PATH_SEPERATOR) // we need to add files to path eg. c:\windows\*.dll or :\windows\* path_files := '${path}\\*' // NOTE:TODO: once we have a way to convert utf16 wide character to utf8 diff --git a/vlib/os/process_nix.c.v b/vlib/os/process_nix.c.v index 82df79760..43d69aaff 100644 --- a/vlib/os/process_nix.c.v +++ b/vlib/os/process_nix.c.v @@ -28,7 +28,7 @@ fn (mut p Process) unix_spawn_process() int { // // Here, we are in the child process. // It still shares file descriptors with the parent process, - // but it is otherwise independant and can do stuff *without* + // but it is otherwise independent and can do stuff *without* // affecting the parent process. // if p.use_pgroup { diff --git a/vlib/time/parse.js.v b/vlib/time/parse.js.v index 83b138d6a..93c80045e 100644 --- a/vlib/time/parse.js.v +++ b/vlib/time/parse.js.v @@ -3,7 +3,7 @@ module time // parse returns time from a date string. // // TODO(playX): JS Date expects iso8061 format of strings and other formats -// are implementation dependant, we probably want to implement parsing in JS. +// are implementation dependent, we probably want to implement parsing in JS. pub fn parse(s string) Time { mut res := Time{} #let date = new Date(s.str) diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 1f5ea33e3..155494383 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -11,7 +11,7 @@ import v.checker.constants const ( bs = '\\' - // when to break a line dependant on penalty + // when to break a line depending on the penalty max_len = [0, 35, 60, 85, 93, 100] ) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index edc8d0827..189555cae 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -2545,7 +2545,7 @@ fn cescape_nonascii(original string) string { for c in original { if c < 32 || c > 126 { // Encode with a 3 digit octal escape code, which has the - // advantage to be limited/non dependant on what character + // advantage to be limited/non dependent on what character // will follow next, unlike hex escapes: write_octal_escape(mut b, c) continue @@ -5457,7 +5457,7 @@ fn (mut g Gen) sort_globals_consts() { } } -// sort structs by dependant fields +// sort structs by dependent fields fn (mut g Gen) sort_structs(typesa []&ast.TypeSymbol) []&ast.TypeSymbol { util.timing_start(@METHOD) defer { @@ -5569,7 +5569,7 @@ fn (mut g Gen) sort_structs(typesa []&ast.TypeSymbol) []&ast.TypeSymbol { // ast.Interface {} else {} } - // add type and dependant types to graph + // add type and dependent types to graph dep_graph.add(sym.name, field_deps) } // sort graph @@ -5579,7 +5579,7 @@ fn (mut g Gen) sort_structs(typesa []&ast.TypeSymbol) []&ast.TypeSymbol { // TODO: should it be removed? verror('cgen.sort_structs(): the following structs form a dependency cycle:\n' + dep_graph_sorted.display_cycles() + - '\nyou can solve this by making one or both of the dependant struct fields references, eg: field &MyStruct' + + '\nyou can solve this by making one or both of the dependent struct fields references, eg: field &MyStruct' + '\nif you feel this is an error, please create a new issue here: https://github.com/vlang/v/issues and tag @joe-conigliaro') } // sort types diff --git a/vlib/v/gen/golang/golang.v b/vlib/v/gen/golang/golang.v index feaeb59d1..2b038ec8a 100644 --- a/vlib/v/gen/golang/golang.v +++ b/vlib/v/gen/golang/golang.v @@ -9,11 +9,7 @@ import v.util import v.pref import os -const ( - bs = '\\' - // when to break a line dependant on penalty - max_len = [0, 35, 60, 85, 93, 100] -) +const bs = '\\' pub struct Gen { pub mut: diff --git a/vlib/v/gen/golang/struct.v b/vlib/v/gen/golang/struct.v index 03d78a50e..e686ea0f4 100644 --- a/vlib/v/gen/golang/struct.v +++ b/vlib/v/gen/golang/struct.v @@ -75,13 +75,6 @@ pub fn (mut f Gen) struct_decl(node ast.StructDecl) { // end_pos := field.pos.pos + field.pos.len volatile_prefix := if field.is_volatile { 'volatile ' } else { '' } f.write('\t${volatile_prefix}${field.name} ') - // before_len := f.line_len - // mut field_align := field_aligns[field_align_i] - // if field_align.line_nr < field.pos.line_nr { - // field_align_i++ - // field_align = field_aligns[field_align_i] - //} - // f.write(strings.repeat(` `, field_align.max_len - field.name.len - comments_len)) f.write(field_types[i]) f.mark_types_import_as_used(field.typ) // attrs_len := inline_attrs_len(field.attrs) diff --git a/vlib/v/util/errors.v b/vlib/v/util/errors.v index e68b3fdb7..964d0917b 100644 --- a/vlib/v/util/errors.v +++ b/vlib/v/util/errors.v @@ -84,8 +84,9 @@ const verror_paths_absolute = os.getenv('VERROR_PATHS') == 'absolute' // path, will be relative to the current working folder. Relative paths are shorter and stabler, // because they only depend on the project, and not on the parent folders. // If the current working folder of the compiler is NOT a prefix of the given path, then this -// function will return an absolute path isntead. Absolute paths are longer, and platform/user -// but they have the advantage of being more easily processible by tools on the same machine. +// function will return an absolute path instead. Absolute paths are longer, and also platform/user +// dependent, but they have the advantage of being more easily processible by tools on the same +// machine. // // The V user can opt out of that relativisation, by setting the environment variable VERROR_PATHS, // to `absolute`. That is useful for starting the V compiler from an IDE or another program, where -- 2.30.2