As arv pointed out, the parser should no longer generate TypeRefs
of UnionKind, so I made it stop doing that. Getting rid of UnionKind
has the side effect of making UnionDesc no longer capable of satisfying
TypeDesc, so one can no longer create a TypeRef that holds a UnionDesc.
That's correct for production, but I'd been using Field structs (which
contain a TypeRef) to define my test cases. Since I still need to test
that the parser correctly handles named union fields in structs, and
Field structs are no longer capable of expressing that, I needed to
create a new testField struct and some attendant types to allow me
to write all my test cases.
Arv pointed out that there's really no difference between a named
union struct field and a struct field whose type is a struct that
contains only an anonymous union. This patch makes the parser replace
the TypeRef of UnionKind in each named union field with a TypeRef of
StructKind that contains only an anon union.
Fixes Issue #286
Other improvements are:
1) Handle albums with more than 1000 photos correctly
2) Fetch original or small images (-small flag)
3) Progress logging and -quiet flag
4) Addition of -force-auth flag
5) Improve handling of http errors
6) Used go fmt and golint on source code
7) If fetching 1 album, merge in albums from previous commit
These should be disallowed, so disallow them. This also makes
us use a map for fields and choices, which is probably the right
way to store that information in Noms anyway. This patch means
we'll be on better footing for converting datastructures to Noms.
Towards issue #281
Parser for Noms type language.
Generated using pigeon (https://github.com/PuerkitoBio/pigeon). This
patch introduces the 'parse' package, which provides an API for
parsing the Noms type language into a datastructure called
parse.Package. A Package contains a lookup table of defined types, a
list of container specializations it requires, and a set of imports
that are required to be satisfied in order for the package to be used.
No type-checking is currently performed; that'll be in a follow-on patch.
Towards Issue #281
1) Reject duplicate 'using' declarations, which required TypeRef.Equals()
2) Allow whitespace after ':' in field declarations
3) Allow " in import statements
4) Misc cleanups