- Replace the JSON number scanner with sign/integer/fraction/exponent
scanning; return Int or Float via 整数/小数 and reject missing digits.
- Add 片段/格式化文本/格式化列表/格式化对象/格式化 recursive formatter.
- Extend fixture 62 with floats ({1,2.5,-3e2,4E-1,{a:1.0},x}) and a compact
round-trip string.
- Update P2 status: only the separate stdlib package and frozen-CLI closure
lane remain.
Gate: fmt, clippy -D warnings, 407 tests passed.
194 lines
4.0 KiB
JSON
194 lines
4.0 KiB
JSON
{
|
|
"args": {},
|
|
"function": "main",
|
|
"stdout": "",
|
|
"value": {
|
|
"items": [
|
|
{
|
|
"entries": {
|
|
"next": {
|
|
"decimal": "20",
|
|
"type": "int"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
"value": {
|
|
"items": [
|
|
{
|
|
"decimal": "1",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"decimal": "23",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"items": [
|
|
{
|
|
"decimal": "4",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"decimal": "5",
|
|
"type": "int"
|
|
}
|
|
],
|
|
"type": "list"
|
|
},
|
|
{
|
|
"decimal": "-6",
|
|
"type": "int"
|
|
}
|
|
],
|
|
"type": "list"
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"entries": {
|
|
"code": {
|
|
"type": "text",
|
|
"value": "json.invalid_array"
|
|
},
|
|
"message": {
|
|
"type": "text",
|
|
"value": "数组缺少逗号或 ]"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": false
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"entries": {
|
|
"code": {
|
|
"type": "text",
|
|
"value": "json.unexpected_eof"
|
|
},
|
|
"message": {
|
|
"type": "text",
|
|
"value": "数组未闭合"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": false
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"entries": {
|
|
"next": {
|
|
"decimal": "35",
|
|
"type": "int"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
"value": {
|
|
"entries": {
|
|
"a": {
|
|
"decimal": "1",
|
|
"type": "int"
|
|
},
|
|
"b": {
|
|
"items": [
|
|
{
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
{
|
|
"type": "none"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"value": "说\"好"
|
|
}
|
|
],
|
|
"type": "list"
|
|
}
|
|
},
|
|
"type": "map"
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"entries": {
|
|
"next": {
|
|
"decimal": "6",
|
|
"type": "int"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
"value": {
|
|
"type": "text",
|
|
"value": "a\nb"
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"entries": {
|
|
"next": {
|
|
"decimal": "37",
|
|
"type": "int"
|
|
},
|
|
"ok": {
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
"value": {
|
|
"items": [
|
|
{
|
|
"decimal": "1",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"type": "float",
|
|
"value": 2.5
|
|
},
|
|
{
|
|
"type": "float",
|
|
"value": -300.0
|
|
},
|
|
{
|
|
"type": "float",
|
|
"value": 0.4
|
|
},
|
|
{
|
|
"entries": {
|
|
"a": {
|
|
"type": "float",
|
|
"value": 1.0
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"value": "x"
|
|
}
|
|
],
|
|
"type": "list"
|
|
}
|
|
},
|
|
"type": "map"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"value": "[1, 2.5, -300.0, 0.4, {\"a\": 1.0}, \"x\"]"
|
|
}
|
|
],
|
|
"type": "list"
|
|
}
|
|
}
|