414 |
} |
} |
415 |
} |
} |
416 |
|
|
417 |
Stream_write_string(f, "}\n"); |
Stream_write_char(f, '}'); |
418 |
} |
} |
419 |
|
|
420 |
static void instrument_function_call(JSParseNode * node, Stream * f) { |
static void instrument_function_call(JSParseNode * node, Stream * f) { |
433 |
Stream_write_char(f, ')'); |
Stream_write_char(f, ')'); |
434 |
return; |
return; |
435 |
} |
} |
|
else { |
|
|
Stream_write_char(f, '('); |
|
|
output_expression(function_node, f, false); |
|
|
Stream_write_char(f, ')'); |
|
|
} |
|
|
} |
|
|
else { |
|
|
output_expression(function_node, f, false); |
|
436 |
} |
} |
437 |
|
output_expression(function_node, f, false); |
438 |
Stream_write_char(f, '('); |
Stream_write_char(f, '('); |
439 |
for (struct JSParseNode * p = function_node->pn_next; p != NULL; p = p->pn_next) { |
for (struct JSParseNode * p = function_node->pn_next; p != NULL; p = p->pn_next) { |
440 |
if (p != node->pn_head->pn_next) { |
if (p != node->pn_head->pn_next) { |
471 |
static void output_expression(JSParseNode * node, Stream * f, bool parenthesize_object_literals) { |
static void output_expression(JSParseNode * node, Stream * f, bool parenthesize_object_literals) { |
472 |
switch (node->pn_type) { |
switch (node->pn_type) { |
473 |
case TOK_FUNCTION: |
case TOK_FUNCTION: |
474 |
|
Stream_write_char(f, '('); |
475 |
instrument_function(node, f, 0, FUNCTION_NORMAL); |
instrument_function(node, f, 0, FUNCTION_NORMAL); |
476 |
|
Stream_write_char(f, ')'); |
477 |
break; |
break; |
478 |
case TOK_COMMA: |
case TOK_COMMA: |
479 |
for (struct JSParseNode * p = node->pn_head; p != NULL; p = p->pn_next) { |
for (struct JSParseNode * p = node->pn_head; p != NULL; p = p->pn_next) { |
856 |
switch (node->pn_type) { |
switch (node->pn_type) { |
857 |
case TOK_FUNCTION: |
case TOK_FUNCTION: |
858 |
instrument_function(node, f, indent, FUNCTION_NORMAL); |
instrument_function(node, f, indent, FUNCTION_NORMAL); |
859 |
|
Stream_write_char(f, '\n'); |
860 |
break; |
break; |
861 |
case TOK_LC: |
case TOK_LC: |
862 |
assert(node->pn_arity == PN_LIST); |
assert(node->pn_arity == PN_LIST); |