@@ -480,7 +480,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
480
480
g.typedefs.writeln ('typedef enum {' )
481
481
mut cur_enum_expr := ''
482
482
mut cur_enum_offset := 0
483
- for j, field in it .fields {
483
+ for field in it .fields {
484
484
g.typedefs.write ('\t ${enum_name} _${field.name} ' )
485
485
if field.has_expr {
486
486
g.typedefs.write (' = ' )
@@ -1918,7 +1918,7 @@ fn (mut g Gen) return_statement(node ast.Return) {
1918
1918
}
1919
1919
1920
1920
fn (mut g Gen) const_decl (node ast.ConstDecl) {
1921
- for i, field in node.fields {
1921
+ for field in node.fields {
1922
1922
name := c_name (field.name)
1923
1923
// TODO hack. Cut the generated value and paste it into definitions.
1924
1924
pos := g.out.len
@@ -3061,7 +3061,7 @@ fn (mut g Gen) gen_str_for_enum(info table.Enum, styp, str_fn_name string) {
3061
3061
g.definitions.writeln ('string ${str_fn_name} ($styp it); // auto' )
3062
3062
g.auto_str_funcs.writeln ('string ${str_fn_name} ($styp it) { /* gen_str_for_enum */' )
3063
3063
g.auto_str_funcs.writeln ('\t switch(it) {' )
3064
- for i, val in info.vals {
3064
+ for val in info.vals {
3065
3065
g.auto_str_funcs.writeln ('\t\t case ${s} _$val : return tos3("$val ");' )
3066
3066
}
3067
3067
g.auto_str_funcs.writeln ('\t\t default: return tos3("unknown enum value");' )
@@ -3075,7 +3075,7 @@ fn (mut g Gen) gen_str_for_struct(info table.Struct, styp, str_fn_name string) {
3075
3075
mut fnames2strfunc := {
3076
3076
'' : ''
3077
3077
} // map[string]string // TODO vfmt bug
3078
- for i, field in info.fields {
3078
+ for field in info.fields {
3079
3079
sym := g.table.get_type_symbol (field.typ)
3080
3080
if sym.kind in [.struct_, .array, .array_fixed, .map , .enum_] {
3081
3081
field_styp := g.typ (field.typ)
0 commit comments