pulumi/pkg
joeduffy 35fddddb78 Bind packages and modules
This change implements a significant amount of the top-level package
and module binding logic, including module and class members.  It also
begins whittling away at the legacy binder logic (which I expect will
disappear entirely in the next checkin).

The scope abstraction has been rewritten in terms of the new tokens
and symbols layers.  Each scope has a symbol table that associates
names with bound symbols, which can be used during lookup.  This
accomplishes lexical scoping of the symbol names, by pushing and
popping at the appropriate times.  I envision all name resolution to
happen during this single binding pass so that we needn't reconstruct
lexical scoping more than once.

Note that we need to do two passes at the top-level, however.  We
must first bind module-level member names to their symbols *before*
we bind any method bodies, otherwise legal intra-module references
might turn up empty-handed during this binding pass.

There is also a type table that associates types with ast.Nodes.
This is how we avoid needing a complete shadow tree of nodes, and/or
avoid needing to mutate the nodes in place.  Every node with a type
gets an entry in the type table.  For example, variable declarations,
expressions, and so on, each get an entry.  This ensures that we can
access type symbols throughout the subsequent passes without needing
to reconstruct scopes or emulating lexical scoping (as described above).

This is a work in progress, so there are a number of important TODOs
in there associated with symbol table management and body binding.
2017-01-19 13:37:47 -08:00
..
cmdutil Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
compiler Bind packages and modules 2017-01-19 13:37:47 -08:00
config Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
diag Implement diag.Diagable on MuIL AST nodes 2017-01-17 18:01:11 -08:00
encoding Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
graph Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
pack Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
tokens Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
util Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00
workspace Begin overhauling semantic phases 2017-01-18 12:18:37 -08:00