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

x.json2: generic-based encoder (finish PR#15137) (#16464)

This commit is contained in:
Hitalo Souza
2022-11-18 06:09:24 -03:00
committed by GitHub
parent 44e2149baa
commit 74613bd636
6 changed files with 210 additions and 54 deletions

View File

@@ -4,7 +4,17 @@
module json2
// `Any` is a sum type that lists the possible types to be decoded and used.
pub type Any = Null | []Any | bool | f32 | f64 | i64 | int | map[string]Any | string | u64
pub type Any = Null
| []Any
| []int
| bool
| f32
| f64
| i64
| int
| map[string]Any
| string
| u64
// `Null` struct is a simple representation of the `null` value in JSON.
pub struct Null {