@@ -1064,25 +1064,34 @@ namespace YAML
10641064 char * end;
10651065 scalar = SCALAR_s (yamlNode);
10661066 number = strtod (scalar, &end);
1067+ bool is_double = false ;
10671068 bool is_bool = false ;
10681069 bool bool_value = false ;
10691070 bool is_string = quoted_implicit || (end == scalar || *end);
10701071 if ( is_string && yaml_node_is_bool ( yamlNode, &bool_value ) ) {
10711072 is_bool = true ;
10721073 }
1074+ if ( SCALAR_Quoted (yamlNode) ) {
1075+ is_string = true ;
1076+ }
1077+ if ( !is_bool && !is_string ) {
1078+ is_double = String (scalar).indexOf (" ." ) > 0 ;
1079+ }
10731080 switch ( nt ) {
10741081 case YAMLNode::Type::Sequence:
10751082 {
10761083 JsonArray array = jsonNode[nodename];
10771084 if (is_bool) array.add ( bool_value );
10781085 else if (is_string) array.add ( scalar );
1079- else array.add ( number );
1086+ else if (is_double) array.add ( number );
1087+ else array.add ( (int64_t )number );
10801088 }
10811089 break ;
10821090 case YAMLNode::Type::Map:
10831091 if (is_bool) jsonNode[nodename] = bool_value;
10841092 else if (is_string) jsonNode[nodename] = scalar;
1085- else jsonNode[nodename] = number;
1093+ else if (is_double) jsonNode[nodename] = number;
1094+ else jsonNode[nodename] = (int64_t )number;
10861095 break ;
10871096 default : YAML_LOG_e (" Error invalid nesting type" ); break ;
10881097 }
@@ -1110,8 +1119,6 @@ namespace YAML
11101119 deserializeYml_JsonObject ( document, itemNode, jsonNode, YAMLNode::Type::Sequence, _nodeItemName.c_str (), depth+1 );
11111120 }
11121121 }
1113-
1114-
11151122 }
11161123 break ;
11171124 case YAML_MAPPING_NODE:
0 commit comments