Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Implemented extensions system. #95

Merged
merged 1 commit into from Jan 23, 2013
Merged

Implemented extensions system. #95

merged 1 commit into from Jan 23, 2013

Commits on Jan 23, 2013

  1. 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.
    jmalloc committed Jan 23, 2013
    Configuration menu
    Copy the full SHA
    0099ed6 View commit details
    Browse the repository at this point in the history