diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:22:00 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:22:00 +0300 |
commit | 6cc7d587a710606d3fe52222707739c7cc1b8651 (patch) | |
tree | 2b6360852d8f966bd83eeb6efd8af90f8e9b83f9 /profile.c | |
parent | e888f1834b88270590b7e04d64c03c75863e4565 (diff) | |
download | egawk-6cc7d587a710606d3fe52222707739c7cc1b8651.tar.gz egawk-6cc7d587a710606d3fe52222707739c7cc1b8651.tar.bz2 egawk-6cc7d587a710606d3fe52222707739c7cc1b8651.zip |
Move to gawk-3.1.3.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 53 |
1 files changed, 45 insertions, 8 deletions
@@ -250,6 +250,44 @@ pprint(register NODE *volatile tree) fprintf(prof_fp, "}\n"); break; + case Node_K_switch: + indent(tree->exec_count); + fprintf(prof_fp, "switch ("); + in_expr++; + pprint(tree->lnode); + in_expr--; + fprintf(prof_fp, ") {\n"); + pprint(tree->rnode); + indent(SPACEOVER); + fprintf(prof_fp, "}\n"); + break; + + case Node_switch_body: + case Node_case_list: + pprint(tree->lnode); + pprint(tree->rnode); + break; + + case Node_K_case: + indent(tree->exec_count); + fprintf(prof_fp, "case "); + in_expr++; + pprint(tree->lnode); + in_expr--; + fprintf(prof_fp, ":\n"); + indent_in(); + pprint(tree->rnode); + indent_out(); + break; + + case Node_K_default: + indent(tree->exec_count); + fprintf(prof_fp, "default:\n"); + indent_in(); + pprint(tree->rnode); + indent_out(); + break; + case Node_K_while: indent(tree->exec_count); fprintf(prof_fp, "while ("); @@ -402,11 +440,14 @@ tree_eval(register NODE *tree) fprintf(prof_fp, "%s", fparms[tree->param_cnt]); return; + case Node_var_new: case Node_var: + case Node_var_array: if (tree->vname != NULL) fprintf(prof_fp, "%s", tree->vname); else - fatal(_("internal error: Node_var with null vname")); + fatal(_("internal error: %s with null vname"), + nodetype2str(tree->type)); return; case Node_val: @@ -538,13 +579,6 @@ tree_eval(register NODE *tree) pp_lhs(tree); return; - case Node_var_array: - if (tree->vname != NULL) - fprintf(prof_fp, "%s", tree->vname); - else - fatal(_("internal error: Node_var_array with null vname")); - return; - case Node_unary_minus: fprintf(prof_fp, " -"); if (is_scalar(tree->subnode->type)) @@ -773,6 +807,7 @@ pp_lhs(register NODE *ptr) fatal(_("attempt to use array `%s' in a scalar context"), ptr->vname); + case Node_var_new: case Node_var: fprintf(prof_fp, "%s", ptr->vname); break; @@ -1254,6 +1289,7 @@ static int is_scalar(NODETYPE type) { switch (type) { + case Node_var_new: case Node_var: case Node_var_array: case Node_val: @@ -1284,6 +1320,7 @@ static int prec_level(NODETYPE type) { switch (type) { + case Node_var_new: case Node_var: case Node_var_array: case Node_param_list: |