Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

nomdl: can't round-trip ref types #3851

Open
aboodman opened this issue Jul 27, 2019 · 6 comments
Open

nomdl: can't round-trip ref types #3851

aboodman opened this issue Jul 27, 2019 · 6 comments

Comments

@aboodman
Copy link
Contributor

aboodman commented Jul 27, 2019

	noms := types.NewValueStore((&chunks.TestStorage{}).NewView())
	emptyBlob := noms.WriteValue(types.NewEmptyBlob(noms))
	foo := types.NewStruct("", types.StructData{"b": emptyBlob})
	s := types.EncodedValue(foo)
	fmt.Println(s) // Prints: struct {b: #2eulo8v8rihcjm0e93brv14dopakkder}
	v := nomdl.MustParse(noms, s)
	fmt.Println(types.EncodedValue(v))

@arv - am I missing something?

@arv
Copy link
Contributor

arv commented Jul 29, 2019

What happens in the last Println?

@aboodman
Copy link
Contributor Author

Oh sorry, it crashes, complaining that it doesn't expect # after b: .

@aboodman
Copy link
Contributor Author

That is, it doesn't make it to the final Println.

@arv
Copy link
Contributor

arv commented Jul 29, 2019

Both the BNF and parseValue is missing support for Ref:

noms/go/nomdl/parser.go

Lines 263 to 271 in a1f990c

// Value :
// Type
// Bool
// Number
// String
// List
// Set
// Map
// Struct

I don’t remember if this was intentional or just an oversight?

@aboodman
Copy link
Contributor Author

aboodman commented Jul 29, 2019 via email

@arv
Copy link
Contributor

arv commented Jul 29, 2019

The current human-readable serialization looks fine and should have no grammar ambiguities.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants