/[jscoverage]/trunk/instrument-js.c
ViewVC logotype

Diff of /trunk/instrument-js.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 375 by siliconforks, Tue Oct 28 05:30:01 2008 UTC revision 376 by siliconforks, Tue Oct 28 05:30:23 2008 UTC
# Line 1126  Line 1126 
1126      Stream_write_string(f, ";\n");      Stream_write_string(f, ";\n");
1127      break;      break;
1128    case TOK_COLON:    case TOK_COLON:
1129      {
1130      assert(node->pn_arity == PN_NAME);      assert(node->pn_arity == PN_NAME);
     /*  
     This one is tricky: can't output instrumentation between the label and the  
     statement it's supposed to label ...  
     */  
1131      Stream_printf(f, "%*s", indent < 2? 0: indent - 2, "");      Stream_printf(f, "%*s", indent < 2? 0: indent - 2, "");
1132      print_string_atom(node->pn_atom, f);      print_string_atom(node->pn_atom, f);
1133      Stream_write_string(f, ":\n");      Stream_write_string(f, ":\n");
1134      /*      JSParseNode * labelled = node->pn_expr;
1135      ... use output_statement instead of instrument_statement.      if (labelled->pn_type == TOK_LEXICALSCOPE) {
1136      */        labelled = labelled->pn_expr;
1137      output_statement(node->pn_expr, f, indent, false);      }
1138        if (labelled->pn_type == TOK_LC) {
1139          /* labelled block */
1140          Stream_printf(f, "%*s", indent, "");
1141          Stream_write_string(f, "{\n");
1142          instrument_statement(labelled, f, indent + 2, false);
1143          Stream_printf(f, "%*s", indent, "");
1144          Stream_write_string(f, "}\n");
1145        }
1146        else {
1147          /*
1148          This one is tricky: can't output instrumentation between the label and the
1149          statement it's supposed to label, so use output_statement instead of
1150          instrument_statement.
1151          */
1152          output_statement(labelled, f, indent, false);
1153        }
1154      break;      break;
1155      }
1156    case TOK_LEXICALSCOPE:    case TOK_LEXICALSCOPE:
1157      /* let statement */      /* let statement */
1158      assert(node->pn_arity == PN_NAME);      assert(node->pn_arity == PN_NAME);

Legend:
Removed from v.375  
changed lines
  Added in v.376

  ViewVC Help
Powered by ViewVC 1.1.24