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:
parent
092f984708
commit
79b4cfb42a
@ -62,7 +62,7 @@ pub fn new_builder(pref &pref.Preferences) Builder {
|
|||||||
$if windows {
|
$if windows {
|
||||||
msvc = find_msvc(pref.m64) or {
|
msvc = find_msvc(pref.m64) or {
|
||||||
if pref.ccompiler == 'msvc' {
|
if pref.ccompiler == 'msvc' {
|
||||||
// verror('Cannot find MSVC on this OS')
|
// verror('cannot find MSVC on this OS')
|
||||||
}
|
}
|
||||||
MsvcResult{
|
MsvcResult{
|
||||||
valid: false
|
valid: false
|
||||||
|
@ -253,7 +253,7 @@ fn find_msvc(m64_target bool) !MsvcResult {
|
|||||||
pub fn (mut v Builder) cc_msvc() {
|
pub fn (mut v Builder) cc_msvc() {
|
||||||
r := v.cached_msvc
|
r := v.cached_msvc
|
||||||
if r.valid == false {
|
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_obj := os.real_path(v.out_name_c + '.obj')
|
||||||
out_name_pdb := os.real_path(v.out_name_c + '.pdb')
|
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.
|
// Also the double quotes at the start ARE needed.
|
||||||
v.show_cc(cmd, out_name_cmd_line, args)
|
v.show_cc(cmd, out_name_cmd_line, args)
|
||||||
if os.user_os() != 'windows' && !v.pref.out_name.ends_with('.c') {
|
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')
|
util.timing_start('C msvc')
|
||||||
res := os.execute(cmd)
|
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) {
|
fn (mut v Builder) build_thirdparty_obj_file_with_msvc(mod string, path string, moduleflags []cflag.CFlag) {
|
||||||
msvc := v.cached_msvc
|
msvc := v.cached_msvc
|
||||||
if msvc.valid == false {
|
if msvc.valid == false {
|
||||||
verror('Cannot find MSVC on this OS')
|
verror('cannot find MSVC on this OS')
|
||||||
}
|
}
|
||||||
// msvc expects .obj not .o
|
// msvc expects .obj not .o
|
||||||
path_without_o_postfix := path[..path.len - 2] // remove .o
|
path_without_o_postfix := path[..path.len - 2] // remove .o
|
||||||
|
@ -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 left_type in ast.unsigned_integer_type_idxs {
|
||||||
if mut right is ast.IntegerLiteral {
|
if mut right is ast.IntegerLiteral {
|
||||||
if right.val[0] == `-` {
|
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)
|
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 left_type in ast.unsigned_integer_type_idxs {
|
||||||
if mut right is ast.IntegerLiteral {
|
if mut right is ast.IntegerLiteral {
|
||||||
if right.val[0] == `-` {
|
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)
|
right.pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ fn (mut c Checker) sql_expr(mut node ast.SqlExpr) ast.Type {
|
|||||||
c.cur_orm_ts = old_ts
|
c.cur_orm_ts = old_ts
|
||||||
}
|
}
|
||||||
if sym.info !is ast.Struct {
|
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
|
return ast.void_type
|
||||||
}
|
}
|
||||||
info := sym.info as ast.Struct
|
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.kind == .block {
|
||||||
if node.or_expr.stmts.len == 0 {
|
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 {
|
if node.or_expr.stmts.len > 0 && node.or_expr.stmts.last() is ast.ExprStmt {
|
||||||
c.expected_or_type = node.typ
|
c.expected_or_type = node.typ
|
||||||
|
@ -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.typ in ast.unsigned_integer_type_idxs {
|
||||||
if field.default_expr is ast.IntegerLiteral {
|
if field.default_expr is ast.IntegerLiteral {
|
||||||
if field.default_expr.val[0] == `-` {
|
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)
|
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 field_info.typ in ast.unsigned_integer_type_idxs {
|
||||||
if mut field.expr is ast.IntegerLiteral {
|
if mut field.expr is ast.IntegerLiteral {
|
||||||
if field.expr.val[0] == `-` {
|
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)
|
field.expr.pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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() {
|
1 | fn main() {
|
||||||
2 | mut u := u32(10)
|
2 | mut u := u32(10)
|
||||||
3 | u = -10
|
3 | u = -10
|
||||||
|
@ -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 {
|
9 | _ := sql db {
|
||||||
10 | select from Person
|
10 | select from Person
|
||||||
11 | } or {
|
11 | } or {
|
||||||
|
@ -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:')!
|
8 | db := sqlite.connect(':memory:')!
|
||||||
9 | _ := sql db {
|
9 | _ := sql db {
|
||||||
10 | select from Person
|
10 | select from Person
|
||||||
|
@ -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 {
|
1 | struct Foo {
|
||||||
2 | mut:
|
2 | mut:
|
||||||
3 | n u32 = -1
|
3 | n u32 = -1
|
||||||
| ~~
|
| ~~
|
||||||
4 | }
|
4 | }
|
||||||
5 |
|
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() {
|
6 | fn main() {
|
||||||
7 | mut foo := Foo{
|
7 | mut foo := Foo{
|
||||||
8 | n: -1
|
8 | n: -1
|
||||||
| ~~
|
| ~~
|
||||||
9 | }
|
9 | }
|
||||||
10 |
|
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 | }
|
9 | }
|
||||||
10 |
|
10 |
|
||||||
11 | foo.n = -1
|
11 | foo.n = -1
|
||||||
|
@ -638,7 +638,7 @@ fn (mut g JsGen) gen_method_decl(it ast.FnDecl, typ FnGenType) {
|
|||||||
for attr in it.attrs {
|
for attr in it.attrs {
|
||||||
if attr.name == 'async' {
|
if attr.name == 'async' {
|
||||||
if g.pref.output_es5 {
|
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
|
has_go = true
|
||||||
break
|
break
|
||||||
|
@ -599,7 +599,7 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
|
|||||||
from_mod_typ := p.parse_type()
|
from_mod_typ := p.parse_type()
|
||||||
from_mod_name := '${mod_name}.${p.prev_tok.lit}'
|
from_mod_name := '${mod_name}.${p.prev_tok.lit}'
|
||||||
if from_mod_name.is_lower() {
|
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
|
break
|
||||||
}
|
}
|
||||||
comments := p.eat_comments()
|
comments := p.eat_comments()
|
||||||
|
Loading…
Reference in New Issue
Block a user