Commit Graph

27 Commits

Author SHA1 Message Date
Rafael Weinstein
7caa08bc5c Complex Types embed a ChunkStore 2015-12-01 10:40:47 -08:00
Erik Arvidsson
a72ce41a1d Go: TypeRef -> Type
Remaining identifiers
2015-11-13 17:54:53 -05:00
Chris Masone
f0f49c6010 Generated Code 2015-11-09 08:35:06 -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
Erik Arvidsson
329e13e0ae Generated code 2015-11-05 16:33:25 -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
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
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
Chris Masone
d3162c9081 Fix botched handling of -in with -out-dir
The output file should always be emitted relative to -out-dir. I was
incorrectly appending the path to the input file onto that provided in
-out-dir to construct the path to the output file.
2015-11-02 14:14:43 -08: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
a9bc416a2f Change Chunks() to return []ref.Ref 2015-10-30 09:24:58 -07:00
Rafael Weinstein
0e0be1c59b Remove trailing newline from json encoding in typed serialization 2015-10-28 17:07:34 -07:00
Erik Arvidsson
a60de44b13 Generated code 2015-10-23 11:04:41 -04:00
Chris Masone
612ca18cf5 generated code 2015-10-22 09:56:31 -07:00
Erik Arvidsson
71197cb4e7 Generated code 2015-10-22 12:33:39 -04:00
Erik Arvidsson
64217a8548 Generated files 2015-10-22 10:49:06 -04:00
Erik Arvidsson
afeef44020 Updated generated code 2015-10-21 19:04:22 -04:00
Erik Arvidsson
91f720be81 NomDL: Need to include the deps in the package 2015-10-21 09:17:35 -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
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
Chris Masone
30422eaa33 Fix a few issues with switching from NamedTypes -> Types and re-run go generate
grammar.peg didn't get updated along with grammar.peg.go in arv's last patch,
so that needed to be fixed. Also, pkg.Parsed had its own field named Types, which
shadowed the one it got by embedded types.Package. This only came into play when
generating code for packages pulled out of a dataset. Since arv had to manually
patch up all generated code in his last patch, he never hit this issue and I
missed it in review.

Now, go generate passes once more. Yay
2015-10-14 14:31:06 -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
Chris Masone
cc15992778 Initial support for importing type pacakges by ref
Towards #294
2015-10-09 15:19:06 -07:00