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

all: fix dependant->dependent typos, cleanup comments

This commit is contained in:
Delyan Angelov 2022-12-02 12:51:00 +02:00
parent 675c362f57
commit e419faf746
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
11 changed files with 15 additions and 26 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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 {

View File

@ -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)

View File

@ -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]
)

View File

@ -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

View File

@ -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:

View File

@ -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)

View File

@ -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