pulumi/pkg/compiler
joeduffy d9631f6e75 Retain unrecognized service properties
During unmarshaling, the default behavior of the stock Golang JSON marshaler,
and consequently the YAML one we used which mimics its behavior, is to toss away
unrecognized properties.  This isn't what we want for two reasons:

First, we want to issue errors/warnings on unrecognized fields to aid in diagnostics;
we will set aside some extensible section for 3rd parties to use.  This is not
addressed in this change, however.

Second, and more pertinent, is that we need to retain unrecognized fields for certain
types like services, which are extensible by default.

Until golang/go#6213 is addressed -- imminent, it seems -- we will have to do a
somewhat hacky workaround to this problem.  This change contains what I consider to
be the "least bad" in that we won't introduce a lot of performance overhead, and
just have to deal with the slight annoyance of the ast.Services node type containing
both Public/Private *and* PublicUntyped/PrivateUntyped fields alongside one another.
The marshaler dumps property bags into the *Untyped fields, and the parsetree analyzer
expands them out into a structured ast.Service type.  Subsequent passes can then
ignore the *Untyped fields altogether.

Note that this would cause some marshaling funkiness if we ever wanted to remarshal
the mutated ASTs back into JSON/YAML.  Since we don't do that right now, however, I've
not made any attempt to keep the two pairs in synch.  Post-parsetree analyzer, we
literally just forget about the *Untyped guys.
2016-11-19 09:01:23 -08:00
..
backends Store BoundType information on Service AST nodes 2016-11-18 18:20:19 -08:00
core Retain unrecognized service properties 2016-11-19 09:01:23 -08:00
predef Sketch out the service compilation for the AWS backend 2016-11-18 18:12:26 -08:00
testdata Bind predefined stack types 2016-11-17 06:10:23 -08:00
binder.go Store BoundType information on Service AST nodes 2016-11-18 18:20:19 -08:00
binder_test.go Add some targeting tests 2016-11-17 13:08:20 -08:00
common_test.go Rename BuildJSON/BuildYAML to just BuildFile 2016-11-17 15:13:36 -08:00
compiler.go Create a new core.Compiland type 2016-11-18 17:08:44 -08:00
compiler_test.go Add Stack subclassing 2016-11-18 17:30:32 -08:00
opts.go Add a Backend interface, and dispatch to it 2016-11-18 12:40:15 -08:00
parser.go Create a new mu/pkg/compiler/core package 2016-11-17 08:52:54 -08:00
parsetree.go Retain unrecognized service properties 2016-11-19 09:01:23 -08:00
parsetree_test.go Add some targeting tests 2016-11-17 13:08:20 -08:00
symbols.go Add rudimentary type binding 2016-11-16 18:55:20 -08:00