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

Add all types of int and float to json decode/encode

This commit is contained in:
Aurélien Foucault
2019-06-24 22:25:35 +02:00
committed by Alex Medvednikov
parent 877f9e7070
commit e285311290
2 changed files with 84 additions and 1 deletions

View File

@ -109,7 +109,9 @@ string res = tos2("");
}
fn is_js_prim(typ string) bool {
return typ == 'int' || typ == 'string' || typ == 'bool'
return typ == 'int' || typ == 'string' ||
typ == 'bool' || typ == 'float' || typ == 'f32' || typ == 'f64' ||
typ == 'i8' || typ == 'i16' || typ == 'i32' || typ == 'i64'
}
fn (p mut Parser) decode_array(typ string) string {