Permalink
Browse files

Add functions declarations, use tabs

  • Loading branch information...
1 parent 5bf4c5f commit c64f4e736c07fdb10dfe624e4b548a1b0d9fbbcd @laruence laruence committed Aug 14, 2012
Showing with 822 additions and 824 deletions.
  1. +17 −21 Zend/zend_compile.c
  2. +2 −0 Zend/zend_compile.h
  3. +8 −8 Zend/zend_language_parser.y
  4. +184 −184 Zend/zend_vm_def.h
  5. +611 −611 Zend/zend_vm_execute.h
View
@@ -2722,7 +2722,7 @@ void zend_do_try(znode *try_token TSRMLS_DC) /* {{{ */
/* }}} */
void zend_do_finally(znode *finally_token TSRMLS_DC) /* {{{ */ {
- finally_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
+ finally_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
} /* }}} */
void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var, znode *first_catch TSRMLS_DC) /* {{{ */
@@ -2776,34 +2776,30 @@ void zend_do_end_catch(znode *catch_token TSRMLS_DC) /* {{{ */
/* }}} */
void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC) /* {{{ */ {
- if (catch_token->op_type != IS_UNUSED) {
- zend_add_catch_element(try_token->u.op.opline_num, catch_token->EA TSRMLS_CC);
- }
+ if (catch_token->op_type != IS_UNUSED) {
+ zend_add_catch_element(try_token->u.op.opline_num, catch_token->EA TSRMLS_CC);
+ }
}
/* }}} */
-
void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC) /* {{{ */
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally");
- }
- if (finally_token->op_type != IS_UNUSED) {
- CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num;
- //try_token->u.op.opline_num = catch_token->u.op.opline_num;
-
- opline->opcode = ZEND_LEAVE;
- SET_UNUSED(opline->op1);
- SET_UNUSED(opline->op2);
- }
- if (catch_token->op_type == IS_UNUSED) {
- CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].catch_op = 0;
- } //else {
- // try_token->u.op.opline_num = catch_token->u.op.opline_num;
- //}
+ if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) {
+ zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally");
+ }
+ if (finally_token->op_type != IS_UNUSED) {
+ CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num;
+ //try_token->u.op.opline_num = catch_token->u.op.opline_num;
+ opline->opcode = ZEND_LEAVE;
+ SET_UNUSED(opline->op1);
+ SET_UNUSED(opline->op2);
+ }
+ if (catch_token->op_type == IS_UNUSED) {
+ CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].catch_op = 0;
+ }
}
/* }}} */
View
@@ -499,6 +499,8 @@ void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC);
void zend_do_try(znode *try_token TSRMLS_DC);
void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var, znode *first_catch TSRMLS_DC);
void zend_do_end_catch(znode *catch_token TSRMLS_DC);
+void zend_do_finally(znode *finally_token TSRMLS_DC);
+void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC);
void zend_do_throw(const znode *expr TSRMLS_DC);
ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time);
@@ -315,23 +315,23 @@ unticked_statement:
| T_DECLARE { $1.u.op.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); }
| ';' /* empty statement */
| T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}'
- catch_statement { zend_do_bind_catch(&$1, &$6 TSRMLS_CC); }
- finally_statement { zend_do_end_finally(&$1, &$6, &$8 TSRMLS_CC); }
+ catch_statement { zend_do_bind_catch(&$1, &$6 TSRMLS_CC); }
+ finally_statement { zend_do_end_finally(&$1, &$6, &$8 TSRMLS_CC); }
| T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); }
| T_GOTO T_STRING ';' { zend_do_goto(&$2 TSRMLS_CC); }
;
catch_statement:
- /* empty */ { $$.op_type = IS_UNUSED; }
- | T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); }
- fully_qualified_class_name { zend_do_first_catch(&$2 TSRMLS_CC); }
- T_VARIABLE ')' { zend_do_begin_catch(&$1, &$4, &$6, &$2 TSRMLS_CC); }
+ /* empty */ { $$.op_type = IS_UNUSED; }
+ | T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); }
+ fully_qualified_class_name { zend_do_first_catch(&$2 TSRMLS_CC); }
+ T_VARIABLE ')' { zend_do_begin_catch(&$1, &$4, &$6, &$2 TSRMLS_CC); }
'{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
additional_catches { zend_do_mark_last_catch(&$2, &$13 TSRMLS_CC); $$ = $1;}
finally_statement:
- /* empty */ { $$.op_type = IS_UNUSED; }
- | T_FINALLY { zend_do_finally(&$1 TSRMLS_CC); } '{' inner_statement_list '}' { $$ = $1; }
+ /* empty */ { $$.op_type = IS_UNUSED; }
+ | T_FINALLY { zend_do_finally(&$1 TSRMLS_CC); } '{' inner_statement_list '}' { $$ = $1; }
;
additional_catches:
Oops, something went wrong.

0 comments on commit c64f4e7

Please sign in to comment.