Skip to content

Commit

Permalink
Fixed custom optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
phalcon committed Apr 4, 2015
1 parent b79dd08 commit 9ab8c26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions optimizers/PhannotParseAnnotationsOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ public function optimize(array $expression, Call $call, CompilationContext $cont

$resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression);

$context->codePrinter->output('if (phannot_parse_annotations(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC) == FAILURE) {');
$context->codePrinter->output("\t" . 'RETURN_MM();');
$context->codePrinter->output('}');
$call->addCallStatusFlag($context);

$context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC);');

$call->checkTempParameters($context);
$call->addCallStatusOrJump($context);

return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
}
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhqlParsePhqlOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont

$call->addCallStatusFlag($context);

$context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = (phql_parse_phql(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC) != FAILURE);');
$context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);');

$call->checkTempParameters($context);
$call->addCallStatusOrJump($context);
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhvoltParseViewOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont

$call->addCallStatusFlag($context);

$context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = (phvolt_parse_view(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ' TSRMLS_CC) != FAILURE);');
$context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ' TSRMLS_CC);');

$call->checkTempParameters($context);
$call->addCallStatusOrJump($context);
Expand Down

0 comments on commit 9ab8c26

Please sign in to comment.