Commit Graph

7 Commits

Author SHA1 Message Date
Dan Willhite bb7f039e69 Remove codegen artifacts from types. 2016-04-20 17:41:09 -07:00
Erik Arvidsson d998d0cc02 Human readable serialization (#1269)
This serializes a Noms Value into a human readable string.

Things remaining:
- Indentation
- Package (but package is going away)
- Parsing

Towards #1153
2016-04-18 16:12:15 -07:00
Chris Masone 82338bb5be Change Value.Chunks() to return []types.RefBase
In pursuit of issue #654, we want to be able to figure out all the
refs contained in a given Value, along with the Types of the Values to
which those refs point. Value.Chunks() _almost_ met those needs, but
it returned a slice of ref.Ref, which doesn't convey any type info.

To address this, this patch does two things:
1) RefBase embeds the Value interface, and
2) Chunks() now returns []types.RefBase

RefBase now provides Type() as well, by virtue of embedding Value, so
callers can just iterate through the slice returned from Chunks() and
gather type info for all the refs embedded in a given Value.

I went all the way and made RefBase a Value instead of just adding the
Type() method because both types.Ref and the generated Ref types are
actually all Values, and doing so allowed me to change the definition of
refBuilderFunc in package_registry.go to be more precise. It now returns
RefBase instead of just Value.
2016-03-21 16:13:14 -06:00
Benjamin Kalman 9a3e73779d Make types.Ref implement the OrderedValue interface.
This fixes the bug where compoundSets/Maps of refs are ordered by their
type.Ref's Ref, rather than their type.Ref's TargetRef.
2015-12-14 11:28:38 -08:00
Rafael Weinstein e5409f2698 Remove MetaSequenceKind from serialization 2015-12-04 13:34:30 -08:00
Rafael Weinstein e75f5097c7 Allow Map & Set to order by natural ordering of element type if available. 2015-11-16 14:30:30 -08:00
Erik Arvidsson b6e034c77e Go: Rename type ref files too 2015-11-13 18:04:05 -05:00