Commit Graph

213 Commits

Author SHA1 Message Date
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
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
Aaron Boodman
a9bc416a2f Change Chunks() to return []ref.Ref 2015-10-30 09:24:58 -07:00
Erik Arvidsson
25e145c7fd Merge pull request #524 from arv/set-type-ref
Make Set TypeRef per instance
2015-10-30 09:49:19 -04:00
Erik Arvidsson
448edf2eb7 Merge pull request #523 from arv/map-type-ref
Make Map TypeRef per instance
2015-10-30 09:49:09 -04:00
Erik Arvidsson
f0b8ec112e Merge pull request #522 from arv/ref-type-ref
Make types.Ref TypeRef per instance
2015-10-30 09:48:58 -04:00
Erik Arvidsson
cf8cdbd55a Make Set TypeRef per instance
This is so that we can use type.Set for "unknown" set types when
decoding chunks.
2015-10-29 18:32:36 -04:00
Erik Arvidsson
66fd0881c7 Make Map TypeRef per instance
This is so that we can use type.Map for "unknown" map types when
decoding chunks.
2015-10-29 18:13:44 -04:00
Erik Arvidsson
9452b2c9a7 Make types.Ref TypeRef per instance
This is so that we can use type.Ref for "unknown" ref types when
decoding chunks.
2015-10-29 17:47:35 -04:00
Erik Arvidsson
c87f18b039 Make List TypeRef per instance
This is so that we can use type.List for "unknown" list types when
decoding chunks.
2015-10-29 17:11:36 -04:00
Erik Arvidsson
67f06a38b5 Get rid of future from List
There were a few remnants of Future in list
2015-10-29 16:54:15 -04:00
Erik Arvidsson
8112c774f4 Remove types/walk.go
It is no longer used and it is not working in the new world where
containers are not implicitly out of line.
2015-10-29 12:56:46 -04:00
Erik Arvidsson
3aa7597788 Merge pull request #516 from arv/map-no-future
Remove future from Map
2015-10-29 12:30:49 -04:00
Erik Arvidsson
ba85881fa3 Remove future from Map
The mapEntry is now using Values instead of Futures
2015-10-29 12:23:19 -04:00
Erik Arvidsson
48f53f33f8 Remove future from Set
The set now uses a []Value as its data. Still sorted by the ref.Ref
2015-10-29 12:05:36 -04:00
Rafael Weinstein
0e0be1c59b Remove trailing newline from json encoding in typed serialization 2015-10-28 17:07:34 -07:00
Dan Willhite
84b99fbc37 Check in generated files with new names and delete old ones. 2015-10-28 14:28:20 -07:00
Erik Arvidsson
d7ac77571c Remove the enc package
Move the remaining files to types/
2015-10-28 12:38:30 -04:00
Erik Arvidsson
c5fe67371d Remove old encoder/decoder
This removes the "j " encoding
2015-10-27 18:02:04 -04:00
Erik Arvidsson
378d60f48a Merge pull request #486 from arv/compound-blob-typed
NomDL: Encode compound blobs as structs
2015-10-27 17:55:57 -04:00
Erik Arvidsson
81f80d5ce6 NomDL: Encode compound blobs as structs
Before encoding a compoundBlob we create a compoundBlobStruct and
encode that instead.

After decoding we check if the value is a compoundBlobStruct and if so
we convert it to a compoundBlob.

Fixes #455, #165
2015-10-27 17:53:16 -04:00
Erik Arvidsson
e4544a4e49 NomDL: Remove extra write of the Package type refs
When writing a Package we were writing the type refs describing the
types in Package. These are never referenced from anywhere and the
information is embedded into the Package chunk.
2015-10-27 16:05:04 -04:00
Erik Arvidsson
8f7661e873 NomDL: Read Package from ChunkSource when decoding
Packages usually gets registered using RegisterPackage which is called
by generated code. However, if the data in the data store was created
using another binary it is unlikely that the current binary registered
the same Package.

When writing values that depends on Packages we write the Package to
the ChunkStore...

When we read a value that depends on a Package and the Package has
not been registered we now read the Package out of the the ChunkStore
and register it for future uses.
2015-10-27 09:49:59 -04:00
Erik Arvidsson
cb233b0f68 Make sure we write packages to the store
When we write a value that has a TypeRef with a package we need to
write that package.

When we write a package that has dependencies we need to write the
dependent packages too.
2015-10-26 19:21:47 -04:00
Erik Arvidsson
cdcf952270 Update TypeRef comment and get rid of useless param
The name param of MakeCompoundTypeRef is always the empty string.

I didn't change the underlying storage or serialization.

Fixes #436, #477
2015-10-26 15:35:45 -04:00
Erik Arvidsson
1d13a878c4 Fix types.Ref and RefKind objects
Ref Values now have a TargetRef() method that returns the ref.Ref of
the target the Value is referencing.

Note: This is a breaking change. In old code the Ref() of the Value was
the Ref of the underlying target.

Fixes #464
2015-10-26 11:18:02 -04:00
Erik Arvidsson
d9a93a4751 Remove compound list 2015-10-26 09:57:53 -04:00
Erik Arvidsson
6c7864edbe Change List to not use futures
This disables the compound list creation and its related tests
2015-10-26 09:34:54 -04:00
Erik Arvidsson
e365b25dc4 Revert "Test travis ci GitHub integration" 2015-10-23 17:10:04 -04:00
Erik Arvidsson
40a3cda40b Test travis ci GitHub integration 2015-10-23 16:59:53 -04:00
Erik Arvidsson
91e7ffb8e1 NomDL Codegen: Parameterize the types package
This allows us to use the codegen from types/ without manual touchups
2015-10-23 11:04:30 -04:00
Chris Masone
1486d84487 Make generated Enum types implement types.Value
Fixes #391
2015-10-22 09:56:26 -07:00
Erik Arvidsson
d668d05801 WriteValue minor fix 2015-10-22 12:36:15 -04:00
Erik Arvidsson
8c4bc79fcd NomDL: Remove $type from struct impl
The implementation of structs is a Map and we used to reserve a key
with the name "$type" for the TypeRef. This is no longer needed since
the TypeRef is a constant per struct and needs no storage.

Fixes #450
2015-10-22 12:33:39 -04:00
Erik Arvidsson
3a5bb571fb NomDL: Remove NomsValue() 2015-10-22 10:47:14 -04:00
Erik Arvidsson
16353f38f8 NomDL: Make the new serialization default
This makes the new typed serialization the default (the old
serialization is not used but the code has not been cleaned up yet).

Some things are no working in the new world:

Chunking -  The compound list is not working correctly any more. The
Chunks method is having issues because it assumed things based on the
old implicit chunking.

Commit - uses a `Set(Commit)` which means that the parent commit is
embedded. We need to change that to be `Set(Ref(Commit))` so that the
parent commit is referenced instead.
2015-10-21 19:04:22 -04:00
Dan Willhite
bb2f983446 Add IsEmpty() function on ref.Ref.
Fixes #337.
2015-10-21 12:07:34 -07:00
Erik Arvidsson
c217ffc74a NomDL Serialization: Need to handle Name and Namespace
MakeUnresolvedTypeRef has a Name and a Namespace and we should
serialize these too or we break Ref equality
2015-10-20 15:24:33 -04:00
Erik Arvidsson
d6869cef35 NomDL: Make Package a primitive type
This solves the bootstrapping problems we are encountering.

Previously Package was a Struct but structs depend on Package.
2015-10-20 10:26:00 -04:00
Chris Masone
9b225dce9b Introduce UnresolvedKind, so TypeRefKind isn't overloaded.
We'd wound up in a spot where serialization code used 'TypeRefKind' to
mean one of two very different things...either an actual value that
describes some Noms type, or a reference to a type definition that
lives somewhere else. To get rid of this ambiguity, we introduce
'UnresolvedKind' to take over the latter meaning. Now, TypeRefKind
means _only_ a value that describes a type. If you want to point off
to a type definition elsewhere in the type package, or in another
type package, use UnresolvedKind.
2015-10-19 09:58:27 -07:00
Erik Arvidsson
e445d8a240 NomDL: Rename SetOrderedType to SetTypes
I missed this when I renamed the field previously
2015-10-19 10:33:57 -04:00
Erik Arvidsson
f064d35253 NomDL: Move pkgRef to UnresolvedDesc
Only unresolved type refs should have a package ref.
2015-10-16 19:39:49 -04:00
Erik Arvidsson
36d9362628 NomDL: Use ordinal for unresolved type refs
Instead of using the name of the type we now use the index of the type
in the Package that defines it.
2015-10-16 17:46:15 -04:00
Benjamin Kalman
a1b824e114 Make List embed the Value interface rather than redefining all methods. 2015-10-16 12:26:29 -07:00
Erik Arvidsson
6185ea1ddb NomDL: Use a list for the types in the package
This does not yet update the serialization to use the ordinal.
2015-10-14 14:49:04 -04:00
Erik Arvidsson
8565f175ee Make sure Chunks includes type.Refs and the TypeRef
Chunks shold return the futures for types.Ref values.

For typed values that have a TypeRef which has a package ref, also
include that.
2015-10-13 11:00:51 -04:00
Erik Arvidsson
e29d9eeb95 NomDL Blob: Remove redundant test 2015-10-12 17:53:51 -04:00
Erik Arvidsson
0d6f8be3e8 NomDL: Use base64 for Blobs for now
Encode embedded blobs as base64 encoded strings.
2015-10-12 17:47:28 -04:00