mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt
This commit is contained in:
parent
7d84ddfa65
commit
20ef2354e7
@ -636,7 +636,8 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
|
|||||||
if is_decl {
|
if is_decl {
|
||||||
g.writeln(';')
|
g.writeln(';')
|
||||||
}
|
}
|
||||||
} else if !var_type.has_flag(.option_mut_param_t) && !g.is_arraymap_set && !str_add && !op_overloaded {
|
} else if !var_type.has_flag(.option_mut_param_t) && !g.is_arraymap_set && !str_add
|
||||||
|
&& !op_overloaded {
|
||||||
g.write(' ${op} ')
|
g.write(' ${op} ')
|
||||||
} else if str_add || op_overloaded {
|
} else if str_add || op_overloaded {
|
||||||
g.write(', ')
|
g.write(', ')
|
||||||
|
@ -186,7 +186,11 @@ fn (mut g Gen) gen_str_for_option(typ ast.Type, styp string, str_fn_name string)
|
|||||||
g.auto_str_funcs.writeln('string indent_${str_fn_name}(${styp} it, int indent_count) {')
|
g.auto_str_funcs.writeln('string indent_${str_fn_name}(${styp} it, int indent_count) {')
|
||||||
g.auto_str_funcs.writeln('\tstring res;')
|
g.auto_str_funcs.writeln('\tstring res;')
|
||||||
g.auto_str_funcs.writeln('\tif (it.state == 0) {')
|
g.auto_str_funcs.writeln('\tif (it.state == 0) {')
|
||||||
deref := if typ.is_ptr() && !typ.has_flag(.option_mut_param_t) { '**(${sym.cname}**)&' } else { '*(${sym.cname}*)' }
|
deref := if typ.is_ptr() && !typ.has_flag(.option_mut_param_t) {
|
||||||
|
'**(${sym.cname}**)&'
|
||||||
|
} else {
|
||||||
|
'*(${sym.cname}*)'
|
||||||
|
}
|
||||||
if sym.kind == .string {
|
if sym.kind == .string {
|
||||||
if typ.nr_muls() > 1 {
|
if typ.nr_muls() > 1 {
|
||||||
g.auto_str_funcs.writeln('\t\tres = ptr_str(*(${sym.cname}**)&it.data);')
|
g.auto_str_funcs.writeln('\t\tres = ptr_str(*(${sym.cname}**)&it.data);')
|
||||||
|
Loading…
Reference in New Issue
Block a user