Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-ld-prime
Commits
975d6c4b
Commit
975d6c4b
authored
Feb 06, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maps and lists now return their style and key and value styles correctly.
parent
32be50ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
13 deletions
+39
-13
_rsrch/nodesolution/impls/list.go
_rsrch/nodesolution/impls/list.go
+15
-5
_rsrch/nodesolution/impls/map.go
_rsrch/nodesolution/impls/map.go
+24
-8
No files found.
_rsrch/nodesolution/impls/list.go
View file @
975d6c4b
...
...
@@ -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
{
...
...
_rsrch/nodesolution/impls/map.go
View file @
975d6c4b
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment