eloquent/typhoon — pull request #95 by jmalloc (2013-01-23 14:11:44+00:00)
Title: Implemented extensions system.

New types:
* ExtensionLoaderInterface
* ExtensionLoader
* ExtensionInterface

`TyphaxASTGenerator` is now constructed with a second parameter, a `ExtensionLoaderInterface`. This parameter is defaulted to a new instance of `ExtensionLoader`.

When an `ExtensionType` is encountered the AST generator queries the extension loader for the appropriate extension, then calls `$extension->generateTypeCheck($this, $type)`, where `$this` is the current `TyphaxASTGenerator` instance, and `$type` is the Typhax `ExtensionType` instance.

The extension is required to produce a Pasta `Closure`, which is injected into the generated code like any other closure-based type check.