dionyziz/llama — pull request #68 by Renelvon (2014-08-11 17:09:27+00:00)
Title: Redesign SymbolTable. Expand AST hierarchy.

### AST:
* Upgrade `FunctionDef` to `ListNode`.
* Attach a `NameNode` superclass to every node worth inserting to some
kind of symbol table.

### Symbol:
* Major API redesign: Insert/Lookup AST nodes instead of identifiers.
* Redesign `Entry` as a thin wrapper around `ast.NameNode`s. Make it a private class of `SymbolTable`.
* Add lineinfo to error messages (using AST nodes).
* Add exception for reporting identifier redefinition.
* Rewrite `lookup_symbol`:
* Drop useless `guard` parametre; always return None if the node is not found.
* Assert correct nesting.
* Inline `_find_name_in_current_scope`.
* Correctly handle case where identifier is not present.
* Rewrite `insert_symbol`:
* Create an `Entry` before inserting it.
* Don't return anything.
* Drop `guard` parametre; always raise an exception when identifier is redefined in same scope.
* Simplify `Scope` class.
* Drop `logger`; the semantic analyzer should notify the user of any errors caught.
* Make `hash_table` private as it should have always been.
* Make provisions for lib namespace initialization.
* Groom code.

### Symbol test:
* Add initial tests for `Scope` and `SymbolTable` APIs.
* Add initial functional tests for `SymbolTable`. Partly adresses #27.