From 396d46d9ca41a37b8654d17d9f5ab5e2f70c8171 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+tobealive@users.noreply.github.com> Date: Sun, 18 Jun 2023 21:36:17 +0200 Subject: [PATCH] ast, builder, checker, parser: fix typos (#18480) --- vlib/v/ast/ast.v | 16 ++++++++-------- vlib/v/ast/table.v | 2 +- vlib/v/ast/types.v | 4 ++-- vlib/v/builder/builder.v | 2 +- vlib/v/builder/cc.v | 2 +- vlib/v/builder/rebuilding.v | 10 +++++----- vlib/v/checker/check_types.v | 2 +- vlib/v/checker/checker.v | 8 ++++---- vlib/v/checker/containers.v | 4 ++-- vlib/v/checker/fn.v | 4 ++-- vlib/v/checker/for.v | 2 +- vlib/v/checker/infix.v | 2 +- vlib/v/checker/tests/immutable_deref.vv | 2 +- .../tests/import_mod_duplicate_as_alias_err.out | 12 ++++++++++++ ...r.vv => import_mod_duplicate_as_alias_err.vv} | 0 .../tests/import_mod_duplicate_as_sub_err.out | 12 ------------ vlib/v/checker/tests/struct_init_wrong_warn.vv | 12 ++++++------ vlib/v/checker/tests/sum_type_exists.out | 4 ++-- vlib/v/checker/tests/sum_type_exists.vv | 2 +- vlib/v/checker/tests/vweb_routing_checks.out | 6 +++--- vlib/v/checker/tests/vweb_routing_checks.vv | 4 ++-- vlib/v/parser/comptime.v | 2 +- vlib/v/parser/fn.v | 2 +- vlib/v/parser/parse_type.v | 2 +- vlib/v/parser/parser.v | 2 +- ...err.out => embedded_struct_attribute_err.out} | 4 ++-- ...e_err.vv => embedded_struct_attribute_err.vv} | 0 vlib/v/parser/v_parser_test.v | 2 +- 28 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 vlib/v/checker/tests/import_mod_duplicate_as_alias_err.out rename vlib/v/checker/tests/{import_mod_duplicate_as_sub_err.vv => import_mod_duplicate_as_alias_err.vv} (100%) delete mode 100644 vlib/v/checker/tests/import_mod_duplicate_as_sub_err.out rename vlib/v/parser/tests/{embeded_struct_attribute_err.out => embedded_struct_attribute_err.out} (51%) rename vlib/v/parser/tests/{embeded_struct_attribute_err.vv => embedded_struct_attribute_err.vv} (100%) diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index f59ce16c68..da51c06e25 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -339,7 +339,7 @@ pub: mod string name string is_pub bool - is_markused bool // an explict `[markused]` tag; the const will NOT be removed by `-skip-unused`, no matter what + is_markused bool // an explicit `[markused]` tag; the const will NOT be removed by `-skip-unused`, no matter what pos token.Pos pub mut: expr Expr // the value expr of field; everything after `=` @@ -520,7 +520,7 @@ pub: is_exported bool // true for `[export: 'exact_C_name']` is_keep_alive bool // passed memory must not be freed (by GC) before function returns is_unsafe bool // true, when [unsafe] is used on a fn - is_markused bool // true, when an explict `[markused]` tag was put on a fn; `-skip-unused` will not remove that fn + is_markused bool // true, when an explicit `[markused]` tag was put on a fn; `-skip-unused` will not remove that fn is_file_translated bool // true, when the file it resides in is `[translated]` receiver StructField // TODO this is not a struct field receiver_pos token.Pos // `(u User)` in `fn (u User) name()` position @@ -790,7 +790,7 @@ pub mut: // (for setting the position after the or block for autofree) is_or bool // `x := foo() or { ... }` is_tmp bool // for tmp for loop vars, so that autofree can skip them - is_auto_heap bool // value whoes address goes out of scope + is_auto_heap bool // value whose address goes out of scope is_stack_obj bool // may be pointer to stack value (`mut` or `&` arg and not [heap] struct) } @@ -818,7 +818,7 @@ pub: has_expr bool pos token.Pos typ_pos token.Pos - is_markused bool // an explict `[markused]` tag; the global will NOT be removed by `-skip-unused` + is_markused bool // an explicit `[markused]` tag; the global will NOT be removed by `-skip-unused` is_volatile bool pub mut: expr Expr @@ -870,7 +870,7 @@ pub mut: scope &Scope = unsafe { nil } stmts []Stmt // all the statements in the source file imports []Import // all the imports - auto_imports []string // imports that were implicitely added + auto_imports []string // imports that were implicitly added embedded_files []EmbeddedFile // list of files to embed in the binary imported_symbols map[string]string // used for `import {symbol}`, it maps symbol => module.symbol errors []errors.Error // all the checker errors in the file @@ -1566,7 +1566,7 @@ pub mut: index AsmArg // gpr } -// adressing modes: +// addressing modes: pub enum AddressingMode { invalid displacement // displacement @@ -1621,7 +1621,7 @@ pub const ( } // no comments because maps do not support comments // r#*: gp registers added in 64-bit extensions, can only be from 8-15 actually - // *mm#: vector/simd registors + // *mm#: vector/simd registers // st#: floating point numbers // cr#: control/status registers // dr#: debug registers @@ -1945,7 +1945,7 @@ pub fn (expr Expr) is_blank_ident() bool { pub fn (expr Expr) pos() token.Pos { // all uncommented have to be implemented // Note: please do not print here. the language server will hang - // as it uses STDIO primarly to communicate ~Ned + // as it uses STDIO primarily to communicate ~Ned match expr { AnonFn { return expr.decl.pos diff --git a/vlib/v/ast/table.v b/vlib/v/ast/table.v index 12da99eb7c..2ab47af4a3 100644 --- a/vlib/v/ast/table.v +++ b/vlib/v/ast/table.v @@ -1351,7 +1351,7 @@ pub fn (t &Table) known_type_names() []string { // has_deep_child_no_ref returns true if type is struct and has any child or nested child with the type of the given name // the given name consists of module and name (`mod.Name`) -// it doesn't care about childs that are references +// it doesn't care about children that are references pub fn (t &Table) has_deep_child_no_ref(ts &TypeSymbol, name string) bool { if ts.info is Struct { for field in ts.info.fields { diff --git a/vlib/v/ast/types.v b/vlib/v/ast/types.v index bcc5546259..23bb8e2949 100644 --- a/vlib/v/ast/types.v +++ b/vlib/v/ast/types.v @@ -1213,7 +1213,7 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string] } // Note, that the duplication of code in some of the match branches here // is VERY deliberate. DO NOT be tempted to use `else {}` instead, because - // that strongly reduces the usefullness of the exhaustive checking that + // that strongly reduces the usefulness of the exhaustive checking that // match does. // Using else{} here led to subtle bugs in vfmt discovered *months* // after the original code was written. @@ -1401,7 +1401,7 @@ fn (t Table) shorten_user_defined_typenames(originalname string, import_aliases } else { // FIXME: clean this case and remove the following if // because it is an hack to format well the type when - // there is a []modul.name + // there is a []mod.name if res.contains('[]') { idx := res.index('.') or { -1 } return res[idx + 1..] diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index 53609a3146..a707ee4df8 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -173,7 +173,7 @@ pub fn (mut b Builder) parse_imports() { // parsed (but not all of them), then this will cause a problem. // we could add a list of parsed files instead, but I think // there is a better solution all around, I will revisit this. - // NOTE: there is a very similar occurance with the way + // NOTE: there is a very similar occurrence with the way // internal module test's work, and this was the reason there // were issues with duplicate declarations, so we should sort // that out in a similar way. diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index c93881efdb..01ad6efb66 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -538,7 +538,7 @@ pub fn (mut v Builder) cc() { mut tcc_output := os.Result{} original_pwd := os.getwd() for { - // try to compile with the choosen compiler + // try to compile with the chosen compiler // if compilation fails, retry again with another mut ccompiler := v.pref.ccompiler if v.pref.os == .wasm32 { diff --git a/vlib/v/builder/rebuilding.v b/vlib/v/builder/rebuilding.v index c30fa4de3f..e16614f908 100644 --- a/vlib/v/builder/rebuilding.v +++ b/vlib/v/builder/rebuilding.v @@ -198,10 +198,10 @@ fn (mut b Builder) rebuild_cached_module(vexe string, imp_path string) string { println('Cached ${imp_path} .o file not found... Building .o file for ${imp_path}') } b.v_build_module(vexe, imp_path) - rebuilded_o := b.pref.cache_manager.mod_exists(imp_path, '.o', imp_path) or { + rebuilt_o := b.pref.cache_manager.mod_exists(imp_path, '.o', imp_path) or { panic('could not rebuild cache module for ${imp_path}, error: ${err.msg()}') } - return rebuilded_o + return rebuilt_o } return res } @@ -227,8 +227,8 @@ fn (mut b Builder) handle_usecache(vexe string) { for imp_stmt in ast_file.imports { imp := imp_stmt.mod // strconv is already imported inside builtin, so skip generating its object file - // TODO: incase we have other modules with the same name, make sure they are vlib - // is this even doign anything? + // TODO: in case we have other modules with the same name, make sure they are vlib + // is this even doing anything? if util.module_is_builtin(imp) { continue } @@ -240,7 +240,7 @@ fn (mut b Builder) handle_usecache(vexe string) { } // The problem is cmd/v is in module main and imports // the relative module named help, which is built as cmd.v.help not help - // currently this got this workign by building into main, see ast.FnDecl in cgen + // currently this got this working by building into main, see ast.FnDecl in cgen if imp == 'help' { continue } diff --git a/vlib/v/checker/check_types.v b/vlib/v/checker/check_types.v index 65f77f5394..d6fea641bd 100644 --- a/vlib/v/checker/check_types.v +++ b/vlib/v/checker/check_types.v @@ -509,7 +509,7 @@ fn (mut c Checker) check_shift(mut node ast.InfixExpr, left_type_ ast.Type, righ match node.op { .left_shift, .right_shift, .unsigned_right_shift { // The following code tries to disallow C UBs and IDs at the V level. - // From the C++ standart (see https://pvs-studio.com/en/docs/warnings/v610/): + // From the C++ standard (see https://pvs-studio.com/en/docs/warnings/v610/): // 1. The type of the result is that of the promoted left operand. // The behavior is undefined (UB), if the right operand is negative, // or greater than or equal to the length in bits of the promoted left operand. diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index f2cdf3b6c7..6ccc1b65e1 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -2116,7 +2116,7 @@ fn (mut c Checker) asm_arg(arg ast.AsmArg, stmt ast.AsmStmt, aliases []string) { c.asm_arg(arg.base, stmt, aliases) c.asm_arg(arg.index, stmt, aliases) } - ast.BoolLiteral {} // all of these are guarented to be correct. + ast.BoolLiteral {} // all of these are guaranteed to be correct. ast.FloatLiteral {} ast.CharLiteral {} ast.IntegerLiteral {} @@ -4012,7 +4012,7 @@ fn (mut c Checker) prefix_expr(mut node ast.PrefixExpr) ast.Type { } // FIXME // there are currently other issues to investigate if right_type - // is unwraped directly as initialization, so do it here + // is unwrapped directly as initialization, so do it here if node.op == .minus && !right_sym.is_number() { c.type_error_for_operator('-', 'numeric', right_sym.name, node.pos) } @@ -4402,7 +4402,7 @@ fn (c &Checker) check_struct_signature(from ast.Struct, to ast.Struct) bool { } counterpart := filtered[0] if field.typ != counterpart.typ { - // field has different tye + // field has different type return false } if field.is_pub != counterpart.is_pub { @@ -4615,7 +4615,7 @@ fn (mut c Checker) ensure_type_exists(typ ast.Type, pos token.Pos) ? { } .int_literal, .float_literal { // Separate error condition for `int_literal` and `float_literal` because `util.suggestion` may give different - // suggestions due to f32 comparision issue. + // suggestions due to f32 comparison issue. if !c.is_builtin_mod { msg := if sym.kind == .int_literal { 'unknown type `${sym.name}`.\nDid you mean `int`?' diff --git a/vlib/v/checker/containers.v b/vlib/v/checker/containers.v index fa01606ccf..4a45e4607f 100644 --- a/vlib/v/checker/containers.v +++ b/vlib/v/checker/containers.v @@ -116,7 +116,7 @@ fn (mut c Checker) array_init(mut node ast.ArrayInit) ast.Type { } // `a = []` if node.exprs.len == 0 { - // `a := fn_returing_opt_array() or { [] }` + // `a := fn_returning_opt_array() or { [] }` if c.expected_type == ast.void_type && c.expected_or_type != ast.void_type { c.expected_type = c.expected_or_type } @@ -128,7 +128,7 @@ fn (mut c Checker) array_init(mut node ast.ArrayInit) ast.Type { } array_info := type_sym.array_info() node.elem_type = array_info.elem_type - // clear option flag incase of: `fn opt_arr() ?[]int { return [] }` + // clear option flag in case of: `fn opt_arr() ?[]int { return [] }` return if c.expected_type.has_flag(.shared_f) { c.expected_type.clear_flag(.shared_f).deref() } else { diff --git a/vlib/v/checker/fn.v b/vlib/v/checker/fn.v index 9fd0f14a20..e42942d5b1 100644 --- a/vlib/v/checker/fn.v +++ b/vlib/v/checker/fn.v @@ -819,7 +819,7 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast. } } if !found && c.pref.is_vsh { - // TOOD: test this hack more extensively + // TODO: test this hack more extensively os_name := 'os.${fn_name}' if f := c.table.find_fn(os_name) { if f.generic_names.len == node.concrete_types.len { @@ -2059,7 +2059,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type { arg) or { // str method, allow type with str method if fn arg is string // Passing an int or a string array produces a c error here - // Deleting this condition results in propper V error messages + // Deleting this condition results in proper V error messages // if arg_typ_sym.kind == .string && typ_sym.has_method('str') { // continue // } diff --git a/vlib/v/checker/for.v b/vlib/v/checker/for.v index fb789a7fc9..95b58d3ba3 100644 --- a/vlib/v/checker/for.v +++ b/vlib/v/checker/for.v @@ -297,7 +297,7 @@ fn (mut c Checker) for_stmt(mut node ast.ForStmt) { } } // TODO: update loop var type - // how does this work currenly? + // how does this work currently? c.check_loop_label(node.label, node.pos) c.stmts(node.stmts) c.loop_label = prev_loop_label diff --git a/vlib/v/checker/infix.v b/vlib/v/checker/infix.v index a728134593..d8e6dad130 100644 --- a/vlib/v/checker/infix.v +++ b/vlib/v/checker/infix.v @@ -340,7 +340,7 @@ fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type { unalias_right_type := c.table.unalias_num_type(unwrapped_right_type) mut promoted_type := c.promote_keeping_aliases(unaliased_left_type, unalias_right_type, left_sym.kind, right_sym.kind) - // substract pointers is allowed in unsafe block + // subtract pointers is allowed in unsafe block is_allowed_pointer_arithmetic := left_type.is_any_kind_of_pointer() && right_type.is_any_kind_of_pointer() && node.op == .minus if is_allowed_pointer_arithmetic { diff --git a/vlib/v/checker/tests/immutable_deref.vv b/vlib/v/checker/tests/immutable_deref.vv index e5021e785e..07ceb724ea 100644 --- a/vlib/v/checker/tests/immutable_deref.vv +++ b/vlib/v/checker/tests/immutable_deref.vv @@ -3,7 +3,7 @@ struct Context {} const ctx_ptr = &Context(unsafe { nil }) fn main() { - // TODO unsafe bug, having this declaration inside `unsafe` results in an erro + // TODO unsafe bug, having this declaration inside `unsafe` results in an error x := &ctx_ptr unsafe { *x = &Context{} diff --git a/vlib/v/checker/tests/import_mod_duplicate_as_alias_err.out b/vlib/v/checker/tests/import_mod_duplicate_as_alias_err.out new file mode 100644 index 0000000000..44ae1fd28e --- /dev/null +++ b/vlib/v/checker/tests/import_mod_duplicate_as_alias_err.out @@ -0,0 +1,12 @@ +vlib/v/checker/tests/import_mod_duplicate_as_alias_err.vv:3:8: error: cannot import `json` into a module with the same name + 1 | module json + 2 | + 3 | import json as vjson + | ~~~~ + 4 | + 5 | const used = true +vlib/v/checker/tests/import_mod_duplicate_as_alias_err.vv:1:1: error: project must include a `main` module or be a shared library (compile with `v -shared`) + 1 | module json + | ^ + 2 | + 3 | import json as vjson \ No newline at end of file diff --git a/vlib/v/checker/tests/import_mod_duplicate_as_sub_err.vv b/vlib/v/checker/tests/import_mod_duplicate_as_alias_err.vv similarity index 100% rename from vlib/v/checker/tests/import_mod_duplicate_as_sub_err.vv rename to vlib/v/checker/tests/import_mod_duplicate_as_alias_err.vv diff --git a/vlib/v/checker/tests/import_mod_duplicate_as_sub_err.out b/vlib/v/checker/tests/import_mod_duplicate_as_sub_err.out deleted file mode 100644 index 1e404ae0c3..0000000000 --- a/vlib/v/checker/tests/import_mod_duplicate_as_sub_err.out +++ /dev/null @@ -1,12 +0,0 @@ -vlib/v/checker/tests/import_mod_duplicate_as_sub_err.vv:3:8: error: cannot import `json` into a module with the same name - 1 | module json - 2 | - 3 | import json as vjson - | ~~~~ - 4 | - 5 | const used = true -vlib/v/checker/tests/import_mod_duplicate_as_sub_err.vv:1:1: error: project must include a `main` module or be a shared library (compile with `v -shared`) - 1 | module json - | ^ - 2 | - 3 | import json as vjson diff --git a/vlib/v/checker/tests/struct_init_wrong_warn.vv b/vlib/v/checker/tests/struct_init_wrong_warn.vv index 39ab8fa646..32ffec4228 100644 --- a/vlib/v/checker/tests/struct_init_wrong_warn.vv +++ b/vlib/v/checker/tests/struct_init_wrong_warn.vv @@ -2,20 +2,20 @@ struct Inner { ptr &u8 } -struct Outter { +struct Outer { Inner mut: size int } -fn new_outter() &Outter { - return &Outter{ +fn new_outer() &Outer { + return &Outer{ ptr: vcalloc(0) size: 1 } } fn main () { - outter := new_outter() - println(outter) -} \ No newline at end of file + outer := new_outer() + println(outer) +} diff --git a/vlib/v/checker/tests/sum_type_exists.out b/vlib/v/checker/tests/sum_type_exists.out index a580ba0f65..03597f0a98 100644 --- a/vlib/v/checker/tests/sum_type_exists.out +++ b/vlib/v/checker/tests/sum_type_exists.out @@ -1,3 +1,3 @@ -vlib/v/checker/tests/sum_type_exists.vv:1:22: error: unknown type `Inexistant` - 1 | type Miscellaneous = Inexistant | Nope | int +vlib/v/checker/tests/sum_type_exists.vv:1:22: error: unknown type `Inexistent` + 1 | type Miscellaneous = Inexistent | Nope | int | ~~~~~~~~~~ \ No newline at end of file diff --git a/vlib/v/checker/tests/sum_type_exists.vv b/vlib/v/checker/tests/sum_type_exists.vv index 28a4475ff7..48a36dc51d 100644 --- a/vlib/v/checker/tests/sum_type_exists.vv +++ b/vlib/v/checker/tests/sum_type_exists.vv @@ -1 +1 @@ -type Miscellaneous = Inexistant | Nope | int +type Miscellaneous = Inexistent | Nope | int diff --git a/vlib/v/checker/tests/vweb_routing_checks.out b/vlib/v/checker/tests/vweb_routing_checks.out index 179437a5e9..ca34b5aecc 100644 --- a/vlib/v/checker/tests/vweb_routing_checks.out +++ b/vlib/v/checker/tests/vweb_routing_checks.out @@ -1,14 +1,14 @@ vlib/v/checker/tests/vweb_routing_checks.vv:20:1: warning: mismatched parameters count between vweb method `App.bar` (1) and route attribute ['/bar'] (0) - 18 | // segfault because path taks 0 vars and fcn takes 1 arg + 18 | // segfault because path takes 0 vars and fcn takes 1 arg 19 | ['/bar'] 20 | pub fn (mut app App) bar(a string) vweb.Result { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | return app.html('works') 22 | } vlib/v/checker/tests/vweb_routing_checks.vv:26:1: warning: mismatched parameters count between vweb method `App.cow` (0) and route attribute ['/cow/:low'] (1) - 24 | // no segfault, but it shouldnt compile + 24 | // no segfault, but it shouldn't compile 25 | ['/cow/:low'] 26 | pub fn (mut app App) cow() vweb.Result { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | return app.html('works') - 28 | } + 28 | } \ No newline at end of file diff --git a/vlib/v/checker/tests/vweb_routing_checks.vv b/vlib/v/checker/tests/vweb_routing_checks.vv index 6954e83c79..55c66edd52 100644 --- a/vlib/v/checker/tests/vweb_routing_checks.vv +++ b/vlib/v/checker/tests/vweb_routing_checks.vv @@ -15,13 +15,13 @@ pub fn (mut app App) foo(a string) vweb.Result { return app.html('works') } -// segfault because path taks 0 vars and fcn takes 1 arg +// segfault because path takes 0 vars and fcn takes 1 arg ['/bar'] pub fn (mut app App) bar(a string) vweb.Result { return app.html('works') } -// no segfault, but it shouldnt compile +// no segfault, but it shouldn't compile ['/cow/:low'] pub fn (mut app App) cow() vweb.Result { return app.html('works') diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index 861a429f94..50d6a6d705 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -261,7 +261,7 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall { } // the tmpl inherits all parent scopes. previous functionality was just to // inherit the scope from which the comptime call was made and no parents. - // this is much simpler and allws access to globals. can be changed if needed. + // this is much simpler and allows access to globals. can be changed if needed. mut file := parse_comptime(tmpl_path, v_code, p.table, p.pref, p.scope) file.path = tmpl_path return ast.ComptimeCall{ diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index cca145d04a..1b90b286dc 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -495,7 +495,7 @@ run them via `v file.v` instead', if file_mode == .v && existing.file_mode != .v { // a definition made in a .c.v file, should have a priority over a .v file definition of the same function if !p.pref.is_fmt { - name = p.prepend_mod('pure_v_but_overriden_by_${existing.file_mode}_${short_fn_name}') + name = p.prepend_mod('pure_v_but_overridden_by_${existing.file_mode}_${short_fn_name}') } } else { p.table.redefined_fns << name diff --git a/vlib/v/parser/parse_type.v b/vlib/v/parser/parse_type.v index 23562015db..22458cbbc4 100644 --- a/vlib/v/parser/parse_type.v +++ b/vlib/v/parser/parse_type.v @@ -794,7 +794,7 @@ fn (mut p Parser) parse_generic_inst_type(name string) ast.Type { p.error_with_pos('interface `${parent_sym.name}` is not a generic interface, cannot instantiate to the concrete types', concrete_types_pos) } else if parent_sym.info.generic_types.len != concrete_types.len { - p.error_with_pos('the number of generic types of interfce `${parent_sym.name}` is inconsistent with the concrete types', + p.error_with_pos('the number of generic types of interface `${parent_sym.name}` is inconsistent with the concrete types', concrete_types_pos) } } diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 73268f46d4..3dafe614b9 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -1704,7 +1704,7 @@ fn (mut p Parser) asm_ios(output bool) []ast.AsmIO { } else if mut expr is ast.Ident { alias = expr.name } - // for constraints like `a`, no alias is needed, it is reffered to as rcx + // for constraints like `a`, no alias is needed, it is referred to as rcx mut comments := []ast.Comment{} for p.tok.kind == .comment { comments << p.comment() diff --git a/vlib/v/parser/tests/embeded_struct_attribute_err.out b/vlib/v/parser/tests/embedded_struct_attribute_err.out similarity index 51% rename from vlib/v/parser/tests/embeded_struct_attribute_err.out rename to vlib/v/parser/tests/embedded_struct_attribute_err.out index e2dfd1adab..2d6c19a4c8 100644 --- a/vlib/v/parser/tests/embeded_struct_attribute_err.out +++ b/vlib/v/parser/tests/embedded_struct_attribute_err.out @@ -1,7 +1,7 @@ -vlib/v/parser/tests/embeded_struct_attribute_err.vv:8:7: error: cannot use attributes on embedded structs +vlib/v/parser/tests/embedded_struct_attribute_err.vv:8:7: error: cannot use attributes on embedded structs 6 | 7 | struct Button { 8 | Size [json: size] // fmt removes [json: size] | ^ 9 | } - 10 | + 10 | \ No newline at end of file diff --git a/vlib/v/parser/tests/embeded_struct_attribute_err.vv b/vlib/v/parser/tests/embedded_struct_attribute_err.vv similarity index 100% rename from vlib/v/parser/tests/embeded_struct_attribute_err.vv rename to vlib/v/parser/tests/embedded_struct_attribute_err.vv diff --git a/vlib/v/parser/v_parser_test.v b/vlib/v/parser/v_parser_test.v index 46e6b9bbfb..cf484a0342 100644 --- a/vlib/v/parser/v_parser_test.v +++ b/vlib/v/parser/v_parser_test.v @@ -259,7 +259,7 @@ fn test_fn_is_html_open_tag() { b = is_html_open_tag('style', s) assert b == false - s = '' + s = '