Commit 975d6c4b authored by Eric Myhre's avatar Eric Myhre

Maps and lists now return their style and key and value styles correctly.

parent 32be50ab
......@@ -214,7 +214,9 @@ func (la *plainList__Assembler) Finish() error {
// validators could run and report errors promptly, if this type had any.
return nil
}
func (plainList__Assembler) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainList__Assembler) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
// -- ListNodeAssembler.ValueAssembler -->
......@@ -265,7 +267,9 @@ func (lva *plainList__ValueAssembler) AssignNode(v ipld.Node) error {
lva.la = nil // invalidate self to prevent further incorrect use.
return nil
}
func (plainList__ValueAssembler) Style() ipld.NodeStyle { panic("later") }
func (plainList__ValueAssembler) Style() ipld.NodeStyle {
return Style__Any{}
}
type plainList__ValueAssemblerMap struct {
ca plainMap__Assembler
......@@ -285,8 +289,12 @@ func (ma *plainList__ValueAssemblerMap) AssembleKey() ipld.NodeAssembler {
func (ma *plainList__ValueAssemblerMap) AssembleValue() ipld.NodeAssembler {
return ma.ca.AssembleValue()
}
func (plainList__ValueAssemblerMap) KeyStyle() ipld.NodeStyle { panic("later") }
func (plainList__ValueAssemblerMap) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainList__ValueAssemblerMap) KeyStyle() ipld.NodeStyle {
return Style__String{}
}
func (plainList__ValueAssemblerMap) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
func (ma *plainList__ValueAssemblerMap) Finish() error {
if err := ma.ca.Finish(); err != nil {
......@@ -309,7 +317,9 @@ type plainList__ValueAssemblerList struct {
func (la *plainList__ValueAssemblerList) AssembleValue() ipld.NodeAssembler {
return la.ca.AssembleValue()
}
func (plainList__ValueAssemblerList) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainList__ValueAssemblerList) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
func (la *plainList__ValueAssemblerList) Finish() error {
if err := la.ca.Finish(); err != nil {
......
......@@ -200,7 +200,9 @@ func (na *plainMap__Assembler) AssignNode(v ipld.Node) error {
// (wait... actually, probably we can? 'Assign' is a "finish" method. we can&should invalidate the wip pointer here.)
panic("later")
}
func (plainMap__Assembler) Style() ipld.NodeStyle { panic("later") }
func (plainMap__Assembler) Style() ipld.NodeStyle {
return Style__Map{}
}
// -- MapNodeAssembler -->
......@@ -262,8 +264,12 @@ func (ma *plainMap__Assembler) Finish() error {
// validators could run and report errors promptly, if this type had any.
return nil
}
func (plainMap__Assembler) KeyStyle() ipld.NodeStyle { panic("later") }
func (plainMap__Assembler) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainMap__Assembler) KeyStyle() ipld.NodeStyle {
return Style__String{}
}
func (plainMap__Assembler) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
// -- MapNodeAssembler.KeyAssembler -->
......@@ -314,7 +320,9 @@ func (mka *plainMap__KeyAssembler) AssignNode(v ipld.Node) error {
}
return mka.AssignString(vs)
}
func (plainMap__KeyAssembler) Style() ipld.NodeStyle { panic("later") } // probably should give the style of plainString, which could say "only stores string kind" (though we haven't made such a feature part of the interface yet).
func (plainMap__KeyAssembler) Style() ipld.NodeStyle {
return Style__String{}
}
// -- MapNodeAssembler.ValueAssembler -->
......@@ -367,7 +375,9 @@ func (mva *plainMap__ValueAssembler) AssignNode(v ipld.Node) error {
mva.ma = nil // invalidate self to prevent further incorrect use.
return nil
}
func (plainMap__ValueAssembler) Style() ipld.NodeStyle { panic("later") }
func (plainMap__ValueAssembler) Style() ipld.NodeStyle {
return Style__Any{}
}
type plainMap__ValueAssemblerMap struct {
ca plainMap__Assembler
......@@ -387,8 +397,12 @@ func (ma *plainMap__ValueAssemblerMap) AssembleKey() ipld.NodeAssembler {
func (ma *plainMap__ValueAssemblerMap) AssembleValue() ipld.NodeAssembler {
return ma.ca.AssembleValue()
}
func (plainMap__ValueAssemblerMap) KeyStyle() ipld.NodeStyle { panic("later") }
func (plainMap__ValueAssemblerMap) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainMap__ValueAssemblerMap) KeyStyle() ipld.NodeStyle {
return Style__String{}
}
func (plainMap__ValueAssemblerMap) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
func (ma *plainMap__ValueAssemblerMap) Finish() error {
if err := ma.ca.Finish(); err != nil {
......@@ -411,7 +425,9 @@ type plainMap__ValueAssemblerList struct {
func (la *plainMap__ValueAssemblerList) AssembleValue() ipld.NodeAssembler {
return la.ca.AssembleValue()
}
func (plainMap__ValueAssemblerList) ValueStyle() ipld.NodeStyle { panic("later") }
func (plainMap__ValueAssemblerList) ValueStyle() ipld.NodeStyle {
return Style__Any{}
}
func (la *plainMap__ValueAssemblerList) Finish() error {
if err := la.ca.Finish(); err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment