| ... | ... | @@ -406,10 +406,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 406 | 406 | render_node(ar, node->data.fn_def.body); |
| 407 | 407 | break; |
| 408 | 408 | } |
| 409 | | case NodeTypeFnDecl: |
| 410 | | zig_panic("TODO"); |
| 411 | | case NodeTypeParamDecl: |
| 412 | | zig_panic("TODO"); |
| 413 | 409 | case NodeTypeBlock: |
| 414 | 410 | fprintf(ar->f, "{\n"); |
| 415 | 411 | ar->indent += ar->indent_size; |
| ... | ... | @@ -463,8 +459,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 463 | 459 | render_node(ar, node->data.type_decl.child_type); |
| 464 | 460 | break; |
| 465 | 461 | } |
| 466 | | case NodeTypeErrorValueDecl: |
| 467 | | zig_panic("TODO"); |
| 468 | 462 | case NodeTypeBinOpExpr: |
| 469 | 463 | fprintf(ar->f, "("); |
| 470 | 464 | render_node(ar, node->data.bin_op_expr.op1); |
| ... | ... | @@ -472,8 +466,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 472 | 466 | render_node(ar, node->data.bin_op_expr.op2); |
| 473 | 467 | fprintf(ar->f, ")"); |
| 474 | 468 | break; |
| 475 | | case NodeTypeUnwrapErrorExpr: |
| 476 | | zig_panic("TODO"); |
| 477 | 469 | case NodeTypeNumberLiteral: |
| 478 | 470 | switch (node->data.number_literal.bignum->kind) { |
| 479 | 471 | case BigNumKindInt: |
| ... | ... | @@ -544,8 +536,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 544 | 536 | render_node(ar, node->data.array_access_expr.subscript); |
| 545 | 537 | fprintf(ar->f, "]"); |
| 546 | 538 | break; |
| 547 | | case NodeTypeSliceExpr: |
| 548 | | zig_panic("TODO"); |
| 549 | 539 | case NodeTypeFieldAccessExpr: |
| 550 | 540 | { |
| 551 | 541 | AstNode *lhs = node->data.field_access_expr.struct_expr; |
| ... | ... | @@ -555,42 +545,9 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 555 | 545 | print_symbol(ar, rhs); |
| 556 | 546 | break; |
| 557 | 547 | } |
| 558 | | case NodeTypeUse: |
| 559 | | zig_panic("TODO"); |
| 560 | | case NodeTypeBoolLiteral: |
| 561 | | zig_panic("TODO"); |
| 562 | | case NodeTypeNullLiteral: |
| 563 | | zig_panic("TODO"); |
| 564 | 548 | case NodeTypeUndefinedLiteral: |
| 565 | | zig_panic("TODO"); |
| 566 | | case NodeTypeZeroesLiteral: |
| 567 | | zig_panic("TODO"); |
| 568 | | case NodeTypeThisLiteral: |
| 569 | | zig_panic("TODO"); |
| 570 | | case NodeTypeIfBoolExpr: |
| 571 | | zig_panic("TODO"); |
| 572 | | case NodeTypeIfVarExpr: |
| 573 | | zig_panic("TODO"); |
| 574 | | case NodeTypeWhileExpr: |
| 575 | | zig_panic("TODO"); |
| 576 | | case NodeTypeForExpr: |
| 577 | | zig_panic("TODO"); |
| 578 | | case NodeTypeSwitchExpr: |
| 579 | | zig_panic("TODO"); |
| 580 | | case NodeTypeSwitchProng: |
| 581 | | zig_panic("TODO"); |
| 582 | | case NodeTypeSwitchRange: |
| 583 | | zig_panic("TODO"); |
| 584 | | case NodeTypeLabel: |
| 585 | | zig_panic("TODO"); |
| 586 | | case NodeTypeGoto: |
| 587 | | zig_panic("TODO"); |
| 588 | | case NodeTypeBreak: |
| 589 | | zig_panic("TODO"); |
| 590 | | case NodeTypeContinue: |
| 591 | | zig_panic("TODO"); |
| 592 | | case NodeTypeAsmExpr: |
| 593 | | zig_panic("TODO"); |
| 549 | fprintf(ar->f, "undefined"); |
| 550 | break; |
| 594 | 551 | case NodeTypeContainerDecl: |
| 595 | 552 | { |
| 596 | 553 | const char *struct_name = buf_ptr(node->data.struct_decl.name); |
| ... | ... | @@ -612,8 +569,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 612 | 569 | fprintf(ar->f, "}"); |
| 613 | 570 | break; |
| 614 | 571 | } |
| 615 | | case NodeTypeStructField: |
| 616 | | zig_panic("TODO"); |
| 617 | 572 | case NodeTypeContainerInitExpr: |
| 618 | 573 | fprintf(ar->f, "("); |
| 619 | 574 | render_node(ar, node->data.container_init_expr.type); |
| ... | ... | @@ -621,8 +576,6 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 621 | 576 | assert(node->data.container_init_expr.entries.length == 0); |
| 622 | 577 | fprintf(ar->f, "}"); |
| 623 | 578 | break; |
| 624 | | case NodeTypeStructValueField: |
| 625 | | zig_panic("TODO"); |
| 626 | 579 | case NodeTypeArrayType: |
| 627 | 580 | { |
| 628 | 581 | fprintf(ar->f, "["); |
| ... | ... | @@ -645,6 +598,31 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 645 | 598 | case NodeTypeVarLiteral: |
| 646 | 599 | fprintf(ar->f, "var"); |
| 647 | 600 | break; |
| 601 | case NodeTypeFnDecl: |
| 602 | case NodeTypeParamDecl: |
| 603 | case NodeTypeErrorValueDecl: |
| 604 | case NodeTypeUnwrapErrorExpr: |
| 605 | case NodeTypeSliceExpr: |
| 606 | case NodeTypeStructField: |
| 607 | case NodeTypeStructValueField: |
| 608 | case NodeTypeUse: |
| 609 | case NodeTypeBoolLiteral: |
| 610 | case NodeTypeNullLiteral: |
| 611 | case NodeTypeZeroesLiteral: |
| 612 | case NodeTypeThisLiteral: |
| 613 | case NodeTypeIfBoolExpr: |
| 614 | case NodeTypeIfVarExpr: |
| 615 | case NodeTypeWhileExpr: |
| 616 | case NodeTypeForExpr: |
| 617 | case NodeTypeSwitchExpr: |
| 618 | case NodeTypeSwitchProng: |
| 619 | case NodeTypeSwitchRange: |
| 620 | case NodeTypeLabel: |
| 621 | case NodeTypeGoto: |
| 622 | case NodeTypeBreak: |
| 623 | case NodeTypeContinue: |
| 624 | case NodeTypeAsmExpr: |
| 625 | zig_panic("TODO more ast rendering"); |
| 648 | 626 | } |
| 649 | 627 | } |
| 650 | 628 | |