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

cgen: remove unneeded comments

This commit is contained in:
Alexander Medvednikov 2022-08-21 01:39:44 +03:00
parent 9932ed9b7e
commit eb6627fe41
2 changed files with 6 additions and 6 deletions

View File

@ -5283,9 +5283,9 @@ fn (mut g Gen) or_block(var_name string, or_block ast.OrExpr, return_type ast.Ty
mr_styp = 'voidptr'
}
if return_type.has_flag(.result) {
g.writeln('if (${cvar_name}.is_error) { /*or block*/ ')
g.writeln('if (${cvar_name}.is_error) {') // /*or block*/ ')
} else {
g.writeln('if (${cvar_name}.state != 0) { /*or block*/ ')
g.writeln('if (${cvar_name}.state != 0) {') // /*or block*/ ')
}
}
if or_block.kind == .block {

View File

@ -251,7 +251,7 @@ fn (mut g Gen) index_of_array(node ast.IndexExpr, sym ast.TypeSymbol) {
tmp_opt := if gen_or { g.new_tmp_var() } else { '' }
tmp_opt_ptr := if gen_or { g.new_tmp_var() } else { '' }
if gen_or {
g.write('$elem_type_str* $tmp_opt_ptr = ($elem_type_str*)/*ee elem_ptr_typ */(array_get_with_check(')
g.write('$elem_type_str* $tmp_opt_ptr = ($elem_type_str*)(array_get_with_check(')
if left_is_ptr && !node.left_type.has_flag(.shared_f) {
g.write('*')
}
@ -263,7 +263,7 @@ fn (mut g Gen) index_of_array(node ast.IndexExpr, sym ast.TypeSymbol) {
if elem_sym.info is ast.FnType {
g.write('((')
g.write_fn_ptr_decl(&elem_sym.info, '')
g.write(')(*($elem_type_str*)/*ee elem_sym */array_get(')
g.write(')(*($elem_type_str*)array_get(')
}
if left_is_ptr && !node.left_type.has_flag(.shared_f) {
g.write('*')
@ -271,7 +271,7 @@ fn (mut g Gen) index_of_array(node ast.IndexExpr, sym ast.TypeSymbol) {
} else if is_direct_array_access {
g.write('(($elem_type_str*)')
} else {
g.write('(*($elem_type_str*)/*ee elem_sym */array_get(')
g.write('(*($elem_type_str*)array_get(')
if left_is_ptr && !node.left_type.has_flag(.shared_f) {
g.write('*')
}
@ -451,7 +451,7 @@ fn (mut g Gen) index_of_map(node ast.IndexExpr, sym ast.TypeSymbol) {
tmp_opt := if gen_or { g.new_tmp_var() } else { '' }
tmp_opt_ptr := if gen_or { g.new_tmp_var() } else { '' }
if gen_or {
g.write('$elem_type_str* $tmp_opt_ptr = ($elem_type_str*)/*ee elem_ptr_typ */(map_get_check(')
g.write('$elem_type_str* $tmp_opt_ptr = ($elem_type_str*)(map_get_check(')
} else {
if g.is_fn_index_call {
if elem_sym.info is ast.FnType {