コード例 #1
0
ファイル: CompilerFile.php プロジェクト: edin/zephir
 /**
  * Adds a function to the function definitions
  *
  * @param FunctionDefinition $func
  * @param array $statement
  */
 public function addFunction(Compiler $compiler, FunctionDefinition $func, $statement = null)
 {
     $compiler->addFunction($func, $statement);
     $funcName = strtolower($func->getInternalName());
     if (isset($this->_functionDefinitions[$funcName])) {
         throw new CompilerException("Function '" . $func->getName() . "' was defined more than one time (in the same file)", $statement);
     }
     $this->_functionDefinitions[$funcName] = $func;
 }