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

all: correct the first letter of error message from uppercase to lowercase (#16481)

This commit is contained in:
shove 2022-11-19 16:43:25 +08:00 committed by GitHub
parent 092f984708
commit 79b4cfb42a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 18 additions and 18 deletions

View File

@ -62,7 +62,7 @@ pub fn new_builder(pref &pref.Preferences) Builder {
$if windows {
msvc = find_msvc(pref.m64) or {
if pref.ccompiler == 'msvc' {
// verror('Cannot find MSVC on this OS')
// verror('cannot find MSVC on this OS')
}
MsvcResult{
valid: false

View File

@ -253,7 +253,7 @@ fn find_msvc(m64_target bool) !MsvcResult {
pub fn (mut v Builder) cc_msvc() {
r := v.cached_msvc
if r.valid == false {
verror('Cannot find MSVC on this OS')
verror('cannot find MSVC on this OS')
}
out_name_obj := os.real_path(v.out_name_c + '.obj')
out_name_pdb := os.real_path(v.out_name_c + '.pdb')
@ -368,7 +368,7 @@ pub fn (mut v Builder) cc_msvc() {
// Also the double quotes at the start ARE needed.
v.show_cc(cmd, out_name_cmd_line, args)
if os.user_os() != 'windows' && !v.pref.out_name.ends_with('.c') {
verror('Cannot build with msvc on ${os.user_os()}')
verror('cannot build with msvc on ${os.user_os()}')
}
util.timing_start('C msvc')
res := os.execute(cmd)
@ -391,7 +391,7 @@ pub fn (mut v Builder) cc_msvc() {
fn (mut v Builder) build_thirdparty_obj_file_with_msvc(mod string, path string, moduleflags []cflag.CFlag) {
msvc := v.cached_msvc
if msvc.valid == false {
verror('Cannot find MSVC on this OS')
verror('cannot find MSVC on this OS')
}
// msvc expects .obj not .o
path_without_o_postfix := path[..path.len - 2] // remove .o

View File

@ -273,7 +273,7 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
if left_type in ast.unsigned_integer_type_idxs {
if mut right is ast.IntegerLiteral {
if right.val[0] == `-` {
c.error('Cannot assign negative value to unsigned integer type',
c.error('cannot assign negative value to unsigned integer type',
right.pos)
}
}
@ -324,7 +324,7 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
if left_type in ast.unsigned_integer_type_idxs {
if mut right is ast.IntegerLiteral {
if right.val[0] == `-` {
c.error('Cannot assign negative value to unsigned integer type',
c.error('cannot assign negative value to unsigned integer type',
right.pos)
}
}

View File

@ -18,7 +18,7 @@ fn (mut c Checker) sql_expr(mut node ast.SqlExpr) ast.Type {
c.cur_orm_ts = old_ts
}
if sym.info !is ast.Struct {
c.error('The table symbol `${sym.name}` has to be a struct', node.table_expr.pos)
c.error('the table symbol `${sym.name}` has to be a struct', node.table_expr.pos)
return ast.void_type
}
info := sym.info as ast.Struct
@ -106,7 +106,7 @@ fn (mut c Checker) sql_expr(mut node ast.SqlExpr) ast.Type {
if node.or_expr.kind == .block {
if node.or_expr.stmts.len == 0 {
c.error('Or block needs to return a default value', node.or_expr.pos)
c.error('or block needs to return a default value', node.or_expr.pos)
}
if node.or_expr.stmts.len > 0 && node.or_expr.stmts.last() is ast.ExprStmt {
c.expected_or_type = node.typ

View File

@ -127,7 +127,7 @@ pub fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
if field.typ in ast.unsigned_integer_type_idxs {
if field.default_expr is ast.IntegerLiteral {
if field.default_expr.val[0] == `-` {
c.error('Cannot assign negative value to unsigned integer type',
c.error('cannot assign negative value to unsigned integer type',
field.default_expr.pos)
}
}
@ -493,7 +493,7 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type {
if field_info.typ in ast.unsigned_integer_type_idxs {
if mut field.expr is ast.IntegerLiteral {
if field.expr.val[0] == `-` {
c.error('Cannot assign negative value to unsigned integer type',
c.error('cannot assign negative value to unsigned integer type',
field.expr.pos)
}
}

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/negative_assign_to_unsigned.vv:3:9: error: Cannot assign negative value to unsigned integer type
vlib/v/checker/tests/negative_assign_to_unsigned.vv:3:9: error: cannot assign negative value to unsigned integer type
1 | fn main() {
2 | mut u := u32(10)
3 | u = -10

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/orm_no_default_value.vv:11:4: error: Or block needs to return a default value
vlib/v/checker/tests/orm_no_default_value.vv:11:4: error: or block needs to return a default value
9 | _ := sql db {
10 | select from Person
11 | } or {

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/orm_not_a_struct.vv:10:15: error: The table symbol `Person` has to be a struct
vlib/v/checker/tests/orm_not_a_struct.vv:10:15: error: the table symbol `Person` has to be a struct
8 | db := sqlite.connect(':memory:')!
9 | _ := sql db {
10 | select from Person

View File

@ -1,18 +1,18 @@
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:3:10: error: Cannot assign negative value to unsigned integer type
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:3:10: error: cannot assign negative value to unsigned integer type
1 | struct Foo {
2 | mut:
3 | n u32 = -1
| ~~
4 | }
5 |
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:8:6: error: Cannot assign negative value to unsigned integer type
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:8:6: error: cannot assign negative value to unsigned integer type
6 | fn main() {
7 | mut foo := Foo{
8 | n: -1
| ~~
9 | }
10 |
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:11:10: error: Cannot assign negative value to unsigned integer type
vlib/v/checker/tests/struct_field_unsign_type_check_err.vv:11:10: error: cannot assign negative value to unsigned integer type
9 | }
10 |
11 | foo.n = -1

View File

@ -638,7 +638,7 @@ fn (mut g JsGen) gen_method_decl(it ast.FnDecl, typ FnGenType) {
for attr in it.attrs {
if attr.name == 'async' {
if g.pref.output_es5 {
verror('Cannot use [async] attribute when outputing ES5 source code')
verror('cannot use [async] attribute when outputing ES5 source code')
}
has_go = true
break

View File

@ -599,7 +599,7 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
from_mod_typ := p.parse_type()
from_mod_name := '${mod_name}.${p.prev_tok.lit}'
if from_mod_name.is_lower() {
p.error_with_pos('The interface name need to have the pascal case', p.prev_tok.pos())
p.error_with_pos('the interface name need to have the pascal case', p.prev_tok.pos())
break
}
comments := p.eat_comments()