This ensures that ReferenceTemplates are not returned from a call to
symbol_space.get_symbol. This is in keeping with the get_type method.
The symbol_space containing all symbol tables has visibility of all
tables and can cross-resolve amongst them. Asking a specific table
for a type may result in a ReferenceTemplate. This feels like a
better solution than having individual tables ask their parent space
to fill in the details of sibling tables.
Fixes#279.
Note: creation of enumerations can be done using Context.object, which
should allow reference of enumeration members by normal type objects.
If it turns out enumerations are never referenced from types, we can
easily remove the try/except in the Module.object method.
Context.object accepts a template or a string name (and now a type
flag). Module.object only accepts a string (because a template already
has most of the stuff built in and might as well be passed to the
Context.object constructor).
The gotcha here is the absolute flag, which must now be set
appropriately in all cases *except* where the module is constructed
with an offset of 0 (whereby it will have no impact).
This removes the assertions that checked plugin devs didn't do anything
overly bad in favour of using mypy to ensure appropriate type-checking.
It also moves the ProgressCallback typing information to constants in
order to avoid circular imports (since constants doesn't import
anything).
Relented on the strict import of direct objects/classes for the typing
module only. Typing module components can be directly imported because
it makes the code really painful to read and write otherwise.
This is still in-line with the python style guide adopted from Google at
http://google.github.io/styleguide/pyguide.html section 2.2.
The introduction of symbol resolution required subresolving "unnamed"
(symbol named) types. The resolution system was changed to pass
constructed objects rather than names, which prevented the referencing
from working properly. This commit changes that bit back and creates a
temporary *type* in the _resolved list for the symbol, then restores
whatever was there before.
We restore it so that people don't get used to looking up symbols using
get_type (we may revisit this decision).
They weren't consistent and they show just remind me how slowly
I've been getting vol 3 written! 5:S
There's git commits to track all of that stuff if we need it.
This allows NativeSymbolTables to be appended to symbol_spaces and
uses this to let automagic modules (which have no existing symbol table
to rely on) to load natives for reading format data.