cgen: add num support for json

This commit is contained in:
kbkpbot 2025-09-12 08:20:49 +08:00
parent 027414533e
commit bcf9bba539

View file

@ -612,8 +612,8 @@ fn (mut g Gen) gen_sumtype_enc_dec(utyp ast.Type, sym ast.TypeSymbol, mut enc st
dec.writeln('\t\t}')
}
if var_t in ['i64', ast.int_type_name, 'int', 'i8', 'u64', 'u32', 'u16', 'byte',
'u8', 'rune', 'f64', 'f32'] {
if var_t in ['i8', 'i16', 'i32', 'i64', ast.int_type_name, 'int', 'u8', 'u16',
'u32', 'u64', 'byte', 'rune', 'f64', 'f32'] {
if number_is_met {
var_num := var_t.replace('__', '.')
last_num := last_number_type.replace('__', '.')