Commit Graph

18 Commits

Author SHA1 Message Date
Chris Masone c80a1c55b3 Merge parse.TypeRef and types.TypeRef
These were two representations of, essentially, the same information.
They were separate because they provided different APIs to similar
information, but the APIs became more similar once we started using
native types (as opposed to Noms types) for the various Make*TypeRef()
functions.

Unifying these is a big step to unifying parse.Package and types.Package,
which is pretty necessary for dealing with imported packages.

Fixes issue #338
2015-09-25 15:17:49 -07:00
Erik Arvidsson 5b3f611104 NomDL Codegen: Add optional flag to Field 2015-09-25 14:38:41 -04:00
cmasone-attic 44a5d53f74 Merge pull request #340 from cmasone-attic/apicleanup
Change types.TypeRef creation API to use native types instead of Noms.
Towards issue #338
2015-09-24 13:56:10 -07:00
Erik Arvidsson fe790b1043 NomDL Codegen: More recursive types issues
Issue #320
2015-09-24 16:52:23 -04:00
Chris Masone b12a89c0df Change types.TypeRef creation API to use native types instead of Noms.
These are just easier to work with. The internal representation remains
the same.

Towards issue #338
2015-09-24 12:57:51 -07:00
Erik Arvidsson b67ab2a9e1 Convert datas/ to nomdl/codegen
This make Commit a typed struct with a Set(Commit).

This also fixes a case where the recursive detection for determining
if a Def can be created was not working.
2015-09-24 12:56:58 -04:00
Chris Masone cdb22e131b Address comments 2015-09-23 11:49:14 -07:00
Chris Masone 63c956a5c5 Add types.TypeRef
We want to explore encoding type information about Noms data in
the Noms database. So, we need some way to describe types. This
takes the shortest path to making a Noms type called "TypeRef" that
is a peer of Set, Map et al and can describe all the types we currently
use.
2015-09-22 16:19:38 -07:00
Erik Arvidsson bcdba6f79e Revert "Direct recursive struct" 2015-09-22 17:01:05 -04:00
Erik Arvidsson a4a29fca7b NomDL codegen: Disallow Defs when we get a recursive go struct
go does not allow recursive struct types

Issue #320
2015-09-22 16:53:58 -04:00
Erik Arvidsson 9e7fa76506 NomDL Codegen: Partial support for recursive types
When computing if a Map/Set key contains another Map/Set/List we need
to ensure that we are not hitting a recursive type or we hit an i-loop.

Partial fix for #320
2015-09-22 09:17:14 -04:00
Erik Arvidsson 2769353a55 NomDL Codegen: Do not create a Def if non comparable
Due to limitations in Go we cannot create a Def for a Map or Set that
has a key that is a Map, Set or a List. This is because the key if a Go
map needs to be a comparable and maps and slices are not comparable.
2015-09-21 19:04:53 -04:00
Erik Arvidsson 8358bfe33a NomDL Codegen: Title case field names for go
Fixes #311
2015-09-21 13:29:16 -04:00
Erik Arvidsson 6e369b85cd NomDL: Change command line to process all .noms files
The codegen.go command line utility now detects the package name from
the file that it was invoked from if `--package` was not provided.

It also processes all `.noms` files in the current directory in case
the `--in` flag was not provided.
2015-09-21 12:19:14 -04:00
Erik Arvidsson 91ac2ef236 NomDL: Ref support
A Ref has a SetValue(v, cs) and a GetValue(cs)

Fixes #306
2015-09-18 17:02:41 -04:00
Erik Arvidsson b52ba691e6 NomDL CodeGen: Struct should use Map for now
This is so that we can transition awapy from nongen

Fixes #312
2015-09-17 18:44:49 -04:00
Erik Arvidsson 24f1f58042 Build fix - run godep again 2015-09-17 14:30:09 -04:00
Erik Arvidsson e10e6224b0 Codegen for NomDL
This adds a new codegen that reads .noms files and generates Go
API for these types

Issue #304
2015-09-17 14:01:49 -04:00