Commit Graph

259 Commits

Author SHA1 Message Date
Dan Willhite 7dd540d5d5 Make generated files stable and consistent with go fmt. 2015-11-24 16:15:35 -08:00
Rafael Weinstein 7ad26393a0 fix TestEnsureRef 2015-11-21 14:27:28 -08:00
Benjamin Kalman 4b901cdc84 Support compoundList.Append. 2015-11-20 16:40:19 -08:00
Rafael Weinstein 710fcc3708 Minor fix for meta_sequence_cursor_test 2015-11-18 17:13:43 -08:00
Rafael Weinstein 12d88c769d Correctly construct metaSequenceCursor 2015-11-18 14:05:54 -08:00
Erik Arvidsson eb4b3cbece Update encode/decode tests to use typed constructors 2015-11-16 18:38:43 -05: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
Rafael Weinstein da2c7461df CompoundList lives again 2015-11-16 11:27:47 -08:00
Erik Arvidsson b6e034c77e Go: Rename type ref files too 2015-11-13 18:04:05 -05:00
Erik Arvidsson a72ce41a1d Go: TypeRef -> Type
Remaining identifiers
2015-11-13 17:54:53 -05:00
Erik Arvidsson 6ca2511a9d Merge pull request #618 from arv/type-describe
Clean up output of Type Describe
2015-11-13 17:48:47 -05:00
Benjamin Kalman efa52fed84 Implement a generic sequence chunker, and use it to create blobs. 2015-11-13 14:21:26 -08:00
Erik Arvidsson f95602a32b Clean up output of Type Describe
Fixes #541
2015-11-13 17:10:11 -05:00
Rafael Weinstein 1653ffdf30 metaSequenceCursor 2015-11-12 19:56:17 -08:00
Rafael Weinstein f0ebce2d74 Added metaSequence + enc/dec & tests 2015-11-10 15:29:44 -08:00
Chris Masone eda9b92870 Rename types.TypeRef to types.Type
There are probably still a lot of variable names and comments to fix,
but this updates all the Go code.

Towards #441
2015-11-09 08:26:32 -08:00
Chris Masone 96221c5079 Remove types.test test binary
I don't think this should have been checked in.
2015-11-06 17:59:05 -08:00
Chris Masone 6b31cf7bc9 Reduce size of test data in Set and Map IterAllP() tests
Building up these big Sets and Maps is really slow, and the purpose of
this test is not to stress-test the code with huge data, but rather to
verify correctness. Since Set and Map are being replaced soon, it doesn't
make sense to improve the existing implementations.
2015-11-06 09:04:13 -08:00
Aaron Boodman 69a86f3036 Rewrite walk() to walk value tree instead of chunks
Also fix quad_tree to take advantage of that to be generic again.

Fixes #445, #497
2015-11-05 16:12:02 -08:00
Chris Masone b54fd91c82 Add Filter() to List
And update collection templates to be backed by the untyped
Filter() implementations.

Fixes #578
2015-11-05 15:15:46 -08:00
Chris Masone c40b57fc41 Generated code 2015-11-05 15:15:07 -08:00
cmasone-attic 7fad0856c3 Merge pull request #579 from cmasone-attic/issue564
IterAllP for typed Maps
2015-11-05 15:14:47 -08:00
Erik Arvidsson cc89fb2d90 Remove the channel from struct reader/builder
Instead use a slice of Value
2015-11-05 16:34:03 -05:00
Erik Arvidsson 329e13e0ae Generated code 2015-11-05 16:33:25 -05:00
Chris Masone 2e68c39b14 Fix xml_importer and pitchmap/index to correctly use typed containers.
Fixes #554
2015-11-05 12:08:22 -08:00
Chris Masone 4e79367d1a IterAllP for typed Maps
Fixes #564
2015-11-05 12:06:10 -08:00
Erik Arvidsson 460841e3ed Clean up registration of Ref values
Ref values use the TargetRef to get the internal implementation

RegisterFromValFunction and ToNomsValueFromTypeRef were only used by
ref values at this point so these were renamed and simplified to be
more specific for ref values
2015-11-05 14:32:45 -05:00
Chris Masone 7b55efa9b6 Generated Code 2015-11-05 08:42:22 -08:00
Chris Masone d66151b4c1 Add IterAllP() to all typed Lists and Sets
Also added IterAllP() to types.Set so it could be used by generated
set code.

Towards #564
2015-11-05 08:42:22 -08:00
Erik Arvidsson 9ba1c4a508 Remove InternalImplementation() from List, Map & Set
Instead register a function to extract the internal backing store.
2015-11-04 18:57:36 -05:00
Erik Arvidsson 8c98964fee Generated code 2015-11-04 18:57:27 -05:00
Erik Arvidsson 7d4e2df45d Add types.Enum
This is needed to be able to round trip enums.

If there is no codegen for an enum that is read from the datastore we
now return a types.Enum which can be serialized back to the same
sequence.
2015-11-04 16:40:07 -05:00
Erik Arvidsson 5f66001324 Make sure that we call fixupTypeRef before we use the Ref
The Ref of a TypeRef is used in a maps and then it is important that
we fix all empty refs to point at the current package.

Remove unneeded calls to fixupTypeRef and make sure we call it just
before using the TypeRef as a key in a map.
2015-11-04 15:18:13 -05:00
Erik Arvidsson 07414d0a9e Remove InternalImplementation from structs
By adding a reader to structs we can remove the function that exposes
the internal implementation details of a struct.
2015-11-04 14:57:52 -05:00
Erik Arvidsson 756b893e8f Remove FromVal functions
The generated objects are all type.Values now so FromVal is not needed
2015-11-04 12:13:55 -05:00
Erik Arvidsson a45ba9df29 Followup minor cleanup
cmasone pointed this out but I missed it before merging.
2015-11-04 12:02:17 -05:00
Erik Arvidsson 9aadd85004 Add types.Struct and improve typed structs
The generated code for typed structs now uses a Go struct which
implements Value directly. The fields in this struct uses the "user"
type. (The union value still uses types.Value though.)

When a typed struct is created by the decoder, it asks for a struct
builder which returns a channel that the values of the fields of the
struct are sent to.
2015-11-04 11:55:07 -05:00
Erik Arvidsson eeaac87d5f Make Chunks return all reachable Refs from the current Value
We now do a recursive call which bottoms out with a ref.Ref for RefKind
Values. This means that we traverse into nested structures consistently.

The effect of this is that we get all the refs that the current chunk
references.
2015-11-03 17:13:20 -05:00
Aaron Boodman c65a776241 Remove compoundObjectToRef from compoundObject 2015-11-02 14:10:03 -08:00
Aaron Boodman 0622c8c860 Remove Future 2015-11-02 13:44:47 -08:00
Aaron Boodman bad6be3037 Remove futureFromValue. Another step toward removing Future. 2015-11-02 13:44:17 -08:00
Aaron Boodman c5b8de8174 Collapse list.go and list_leaf.go since we only have one impl. 2015-11-02 13:20:38 -08:00
Erik Arvidsson 89734aae9e Add runtime type assertions for the basic compound types
If we have a List, Map, Set or Ref with a non Value element type we
now check the type of the params to functions that "mutate" these.
2015-11-02 11:57:49 -05:00
Erik Arvidsson 62fad2d615 Merge pull request #536 from arv/equals-by-ref
Make Equals compare by Ref (after comparing TypeRef)
2015-10-30 18:35:08 -04:00
Aaron Boodman 894e615696 Merge pull request #535 from aboodman/blob-future
Convert NewBlob() away from using resolvedFutures
2015-10-30 15:05:09 -07:00
Erik Arvidsson 3c0ef5bcbb Make primitives reasonable 2015-10-30 17:33:47 -04:00
Erik Arvidsson 30cc7d518f Make Equals compare by Ref (after comparing TypeRef)
This changes equal to compare by ref. Since computing the ref can be
expensive we first check that the type refs are equal.

Fixes #532
2015-10-30 16:50:49 -04:00
Aaron Boodman c52bf0bbf5 Convert NewBlob() away from using resolvedFutures
Instead, use a backing MemoryStore. This is part of removing Futures.
2015-10-30 12:50:56 -07:00
Dan Willhite 80be862fda Regroup common code. 2015-10-30 10:36:34 -07:00
Dan Willhite 42bac09422 Make sfcrime/quad_tree apps work with new nomsdl types.
Change generated files to <base>.noms.go
2015-10-30 10:23:15 -07:00