Move from symbol-level modules to file level modules
Summary:
TSIA; ultimately, we want modules to be declared *out of band*, that is outside of normal Hack source code. This is a step towards that.
There were two options here for how to get module info to the right decls:
1. Determine the module up front when parsing the file and thread it through lowering / whatever
2. Keep the file attributes on the AST and use them when needed.
(1) seems like the "good" thing to do here, but (2) was already partially done (functions and classes both kept file attributes around, typedefs I had to add it).
The main annoyance here was threading through file attributes: we drop them in a few places, and they're set erratically. This *should* keep them around long enough s.t. we can fill in module info.
There are a few follow up tasks (which are noted in source code).
1. Record handling is just non-existent. Given HHVM record support was removed, I'm not particularly concerned.
2. We no longer error when giving the `__Module` attribute more than one argument.
Reviewed By: andrewjkennedy
Differential Revision:
D32506191
fbshipit-source-id:
701979e5f5ee7c2e1315302c88763f81cef2c45f