@@ -1134,20 +1134,20 @@ fn (mut g Gen) expr_with_cast(expr ast.Expr, got_type, expected_type table.Type)
1134
1134
got_sym := g.table.get_type_symbol (got_type)
1135
1135
if expected_is_ptr && got_is_ptr {
1136
1136
exp_der_styp := g.typ (expected_deref_type)
1137
- g.write ('/* sum type cast */ ($exp_styp ) memdup(&($exp_der_styp ){.obj = ' )
1137
+ g.write ('/* sum type cast */ ($exp_styp ) memdup(&($exp_der_styp ){._object = ' )
1138
1138
g.expr (expr)
1139
1139
g.write (', .typ = $got_idx /* $got_sym.name */}, sizeof($exp_der_styp ))' )
1140
1140
} else if expected_is_ptr {
1141
1141
exp_der_styp := g.typ (expected_deref_type)
1142
- g.write ('/* sum type cast */ ($exp_styp ) memdup(&($exp_der_styp ){.obj = memdup(&($got_styp []) {' )
1142
+ g.write ('/* sum type cast */ ($exp_styp ) memdup(&($exp_der_styp ){._object = memdup(&($got_styp []) {' )
1143
1143
g.expr (expr)
1144
1144
g.write ('}, sizeof($got_styp )), .typ = $got_idx /* $got_sym.name */}, sizeof($exp_der_styp ))' )
1145
1145
} else if got_is_ptr {
1146
- g.write ('/* sum type cast */ ($exp_styp ) {.obj = ' )
1146
+ g.write ('/* sum type cast */ ($exp_styp ) {._object = ' )
1147
1147
g.expr (expr)
1148
1148
g.write (', .typ = $got_idx /* $got_sym.name */}' )
1149
1149
} else {
1150
- g.write ('/* sum type cast */ ($exp_styp ) {.obj = memdup(&($got_styp []) {' )
1150
+ g.write ('/* sum type cast */ ($exp_styp ) {._object = memdup(&($got_styp []) {' )
1151
1151
g.expr (expr)
1152
1152
g.write ('}, sizeof($got_styp )), .typ = $got_idx /* $got_sym.name */}' )
1153
1153
}
@@ -2604,7 +2604,7 @@ fn (mut g Gen) match_expr(node ast.MatchExpr) {
2604
2604
g.expr (node.cond)
2605
2605
dot_or_ptr := if node.cond_type.is_ptr () { '->' } else { '.' }
2606
2606
g.write (dot_or_ptr)
2607
- g.writeln ('obj ; // ST it' )
2607
+ g.writeln ('_object ; // ST it' )
2608
2608
if node.var_name.len > 0 {
2609
2609
// for now we just copy it
2610
2610
g.writeln ('\t $it_type * $node.var_name = it;' )
@@ -2788,7 +2788,7 @@ fn (mut g Gen) if_expr(node ast.IfExpr) {
2788
2788
} else {
2789
2789
g.write ('.' )
2790
2790
}
2791
- g.writeln ('obj ;' )
2791
+ g.writeln ('_object ;' )
2792
2792
g.writeln ('\t $it_type * $branch.left_as_name = _sc_tmp_$branch.pos.pos ;' )
2793
2793
}
2794
2794
g.stmts (branch.stmts)
@@ -3773,7 +3773,7 @@ fn (mut g Gen) write_types(types []table.TypeSymbol) {
3773
3773
g.type_definitions.writeln ('// | ${sv:4d} = ${g.typ(sv):-20s} ' )
3774
3774
}
3775
3775
g.type_definitions.writeln ('typedef struct {' )
3776
- g.type_definitions.writeln (' void* obj ;' )
3776
+ g.type_definitions.writeln (' void* _object ;' )
3777
3777
g.type_definitions.writeln (' int typ;' )
3778
3778
g.type_definitions.writeln ('} $name ;' )
3779
3779
g.type_definitions.writeln ('' )
@@ -4704,7 +4704,7 @@ fn (mut g Gen) as_cast(node ast.AsCast) {
4704
4704
g.write ('/* as */ ($styp *)__as_cast(' )
4705
4705
g.expr (node.expr)
4706
4706
g.write (dot)
4707
- g.write ('obj , ' )
4707
+ g.write ('_object , ' )
4708
4708
g.expr (node.expr)
4709
4709
g.write (dot)
4710
4710
g.write ('typ, /*expected:*/$node.typ )' )
0 commit comments