<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/json_array/read.go
diff options
context:
space:
mode:
Diffstat (limited to 'json_array/read.go')
-rw-r--r--json_array/read.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/json_array/read.go b/json_array/read.go
index 6334197..786bc2c 100644
--- a/json_array/read.go
+++ b/json_array/read.go
@@ -15,30 +15,30 @@ const (
stateDead
)
-func atomiseValue(value interface{}) []walk.Atom {
+func atomiseValue(value interface{}) []walk.AtomOLD {
switch v := value.(type) {
case nil:
- return []walk.Atom{walk.NewAtomNull()}
+ return []walk.AtomOLD{walk.NewAtomNull()}
case bool:
- return []walk.Atom{walk.NewAtomBool(v)}
+ return []walk.AtomOLD{walk.NewAtomBool(v)}
case float64:
- return []walk.Atom{walk.NewAtomNumber(v)}
+ return []walk.AtomOLD{walk.NewAtomNumber(v)}
case string:
- atoms := []walk.Atom{walk.NewAtomStringTerminal()}
+ atoms := []walk.AtomOLD{walk.NewAtomStringTerminal()}
for _, r := range v {
atoms = append(atoms, walk.NewAtomStringRune(r))
}
atoms = append(atoms, walk.NewAtomStringTerminal())
return atoms
case []interface{}:
- atoms := []walk.Atom{walk.NewAtomTerminal(walk.ArrayBegin)}
+ atoms := []walk.AtomOLD{walk.NewAtomTerminal(walk.ArrayBegin)}
for _, element := range v {
atoms = append(atoms, atomiseValue(element)...)
}
atoms = append(atoms, walk.NewAtomTerminal(walk.ArrayEnd))
return atoms
case map[string]interface{}:
- atoms := []walk.Atom{walk.NewAtomTerminal(walk.MapBegin)}
+ atoms := []walk.AtomOLD{walk.NewAtomTerminal(walk.MapBegin)}
for key, element := range v {
atoms = append(atoms, atomiseValue(key)...)
atoms = append(atoms, atomiseValue(element)...)
@@ -90,8 +90,8 @@ func (in *JSONArrayReader) Read() (walk.WalkItem, error) {
}
in.index += 1
return walk.WalkItem {
- Path: []walk.Atom{walk.NewAtomNumber(float64(in.index - 1))},
- Value: atomiseValue(m),
+ Path: []interface{}{float64(in.index - 1)},
+ Value: []interface{}{m},
}, nil
case stateEnd:
arrayEnd, err := in.decoder.Token()