| ... | ... | @@ -123,12 +123,7 @@ const Parser = struct { |
| 123 | 123 | pub fn parseFnProto(p: *Parser) bool { |
| 124 | 124 | return blk_0: { |
| 125 | 125 | const pos_0 = p.i; |
| 126 | | if (p.parseKEYWORD_fn() and (p.parseIDENTIFIER() or true) and p.parseLPAREN() and p.parseParamDeclList() and p.parseRPAREN() and (p.parseByteAlign() or true) and (p.parseAddrSpace() or true) and (p.parseLinkSection() or true) and (p.parseCallConv() or true) and (p.parseEXCLAMATIONMARK() or true) and p.parseTypeExpr() and blk_1: { |
| 127 | | const pos_1 = p.i; |
| 128 | | const match_1 = p.parseExprSuffix(); |
| 129 | | p.i = pos_1; |
| 130 | | break :blk_1 !match_1; |
| 131 | | }) break :blk_0 true; |
| 126 | if (p.parseKEYWORD_fn() and (p.parseIDENTIFIER() or true) and p.parseLPAREN() and p.parseParamDeclList() and p.parseRPAREN() and (p.parseByteAlign() or true) and (p.parseAddrSpace() or true) and (p.parseLinkSection() or true) and (p.parseCallConv() or true) and (p.parseEXCLAMATIONMARK() or true) and p.parseTypeExpr()) break :blk_0 true; |
| 132 | 127 | p.i = pos_0; |
| 133 | 128 | break :blk_0 false; |
| 134 | 129 | }; |
| ... | ... | @@ -571,83 +566,17 @@ const Parser = struct { |
| 571 | 566 | p.i = pos_0; |
| 572 | 567 | if (p.parseIfExpr()) break :blk_0 true; |
| 573 | 568 | p.i = pos_0; |
| 574 | | if (p.parseKEYWORD_break() and (p.parseBreakLabel() or true) and blk_2: { |
| 575 | | const pos_2 = p.i; |
| 576 | | if (p.parseExpr() and blk_3: { |
| 577 | | const pos_3 = p.i; |
| 578 | | const match_3 = p.parseExprSuffix(); |
| 579 | | p.i = pos_3; |
| 580 | | break :blk_3 !match_3; |
| 581 | | }) break :blk_2 true; |
| 582 | | p.i = pos_2; |
| 583 | | if (blk_3: { |
| 584 | | const pos_3 = p.i; |
| 585 | | const match_3 = p.parseSinglePtrTypeStart(); |
| 586 | | p.i = pos_3; |
| 587 | | break :blk_3 !match_3; |
| 588 | | }) break :blk_2 true; |
| 589 | | p.i = pos_2; |
| 590 | | break :blk_2 false; |
| 591 | | }) break :blk_0 true; |
| 569 | if (p.parseKEYWORD_break() and (p.parseBreakLabel() or true) and (p.parseExpr() or true)) break :blk_0 true; |
| 592 | 570 | p.i = pos_0; |
| 593 | | if (p.parseKEYWORD_comptime() and p.parseExpr() and blk_1: { |
| 594 | | const pos_1 = p.i; |
| 595 | | const match_1 = p.parseExprSuffix(); |
| 596 | | p.i = pos_1; |
| 597 | | break :blk_1 !match_1; |
| 598 | | }) break :blk_0 true; |
| 571 | if (p.parseKEYWORD_comptime() and p.parseExpr()) break :blk_0 true; |
| 599 | 572 | p.i = pos_0; |
| 600 | | if (p.parseKEYWORD_nosuspend() and p.parseExpr() and blk_1: { |
| 601 | | const pos_1 = p.i; |
| 602 | | const match_1 = p.parseExprSuffix(); |
| 603 | | p.i = pos_1; |
| 604 | | break :blk_1 !match_1; |
| 605 | | }) break :blk_0 true; |
| 573 | if (p.parseKEYWORD_nosuspend() and p.parseExpr()) break :blk_0 true; |
| 606 | 574 | p.i = pos_0; |
| 607 | | if (p.parseKEYWORD_continue() and (p.parseBreakLabel() or true) and blk_2: { |
| 608 | | const pos_2 = p.i; |
| 609 | | if (p.parseExpr() and blk_3: { |
| 610 | | const pos_3 = p.i; |
| 611 | | const match_3 = p.parseExprSuffix(); |
| 612 | | p.i = pos_3; |
| 613 | | break :blk_3 !match_3; |
| 614 | | }) break :blk_2 true; |
| 615 | | p.i = pos_2; |
| 616 | | if (blk_3: { |
| 617 | | const pos_3 = p.i; |
| 618 | | const match_3 = p.parseSinglePtrTypeStart(); |
| 619 | | p.i = pos_3; |
| 620 | | break :blk_3 !match_3; |
| 621 | | }) break :blk_2 true; |
| 622 | | p.i = pos_2; |
| 623 | | break :blk_2 false; |
| 624 | | }) break :blk_0 true; |
| 575 | if (p.parseKEYWORD_continue() and (p.parseBreakLabel() or true) and (p.parseExpr() or true)) break :blk_0 true; |
| 625 | 576 | p.i = pos_0; |
| 626 | | if (p.parseKEYWORD_resume() and p.parseExpr() and blk_1: { |
| 627 | | const pos_1 = p.i; |
| 628 | | const match_1 = p.parseExprSuffix(); |
| 629 | | p.i = pos_1; |
| 630 | | break :blk_1 !match_1; |
| 631 | | }) break :blk_0 true; |
| 577 | if (p.parseKEYWORD_resume() and p.parseExpr()) break :blk_0 true; |
| 632 | 578 | p.i = pos_0; |
| 633 | | if (p.parseKEYWORD_return() and blk_2: { |
| 634 | | const pos_2 = p.i; |
| 635 | | if (p.parseExpr() and blk_3: { |
| 636 | | const pos_3 = p.i; |
| 637 | | const match_3 = p.parseExprSuffix(); |
| 638 | | p.i = pos_3; |
| 639 | | break :blk_3 !match_3; |
| 640 | | }) break :blk_2 true; |
| 641 | | p.i = pos_2; |
| 642 | | if (blk_3: { |
| 643 | | const pos_3 = p.i; |
| 644 | | const match_3 = p.parseSinglePtrTypeStart(); |
| 645 | | p.i = pos_3; |
| 646 | | break :blk_3 !match_3; |
| 647 | | }) break :blk_2 true; |
| 648 | | p.i = pos_2; |
| 649 | | break :blk_2 false; |
| 650 | | }) break :blk_0 true; |
| 579 | if (p.parseKEYWORD_return() and (p.parseExpr() or true)) break :blk_0 true; |
| 651 | 580 | p.i = pos_0; |
| 652 | 581 | if ((p.parseBlockLabel() or true) and p.parseLoopExpr()) break :blk_0 true; |
| 653 | 582 | p.i = pos_0; |
| ... | ... | @@ -666,12 +595,7 @@ const Parser = struct { |
| 666 | 595 | if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseExpr()) break :blk_3 true; |
| 667 | 596 | p.i = pos_3; |
| 668 | 597 | break :blk_3 false; |
| 669 | | } or true) and blk_1: { |
| 670 | | const pos_1 = p.i; |
| 671 | | const match_1 = p.parseExprSuffix(); |
| 672 | | p.i = pos_1; |
| 673 | | break :blk_1 !match_1; |
| 674 | | }) break :blk_0 true; |
| 598 | } or true)) break :blk_0 true; |
| 675 | 599 | p.i = pos_0; |
| 676 | 600 | break :blk_0 false; |
| 677 | 601 | }; |
| ... | ... | @@ -717,11 +641,6 @@ const Parser = struct { |
| 717 | 641 | }) break :blk_2 true; |
| 718 | 642 | p.i = pos_2; |
| 719 | 643 | break :blk_2 false; |
| 720 | | } and blk_1: { |
| 721 | | const pos_1 = p.i; |
| 722 | | const match_1 = p.parseExprSuffix(); |
| 723 | | p.i = pos_1; |
| 724 | | break :blk_1 !match_1; |
| 725 | 644 | }) break :blk_0 true; |
| 726 | 645 | p.i = pos_0; |
| 727 | 646 | break :blk_0 false; |
| ... | ... | @@ -735,12 +654,7 @@ const Parser = struct { |
| 735 | 654 | if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseExpr()) break :blk_3 true; |
| 736 | 655 | p.i = pos_3; |
| 737 | 656 | break :blk_3 false; |
| 738 | | } or true) and blk_1: { |
| 739 | | const pos_1 = p.i; |
| 740 | | const match_1 = p.parseExprSuffix(); |
| 741 | | p.i = pos_1; |
| 742 | | break :blk_1 !match_1; |
| 743 | | }) break :blk_0 true; |
| 657 | } or true)) break :blk_0 true; |
| 744 | 658 | p.i = pos_0; |
| 745 | 659 | break :blk_0 false; |
| 746 | 660 | }; |
| ... | ... | @@ -848,12 +762,7 @@ const Parser = struct { |
| 848 | 762 | p.i = pos_0; |
| 849 | 763 | if (p.parseIfTypeExpr()) break :blk_0 true; |
| 850 | 764 | p.i = pos_0; |
| 851 | | if (p.parseKEYWORD_comptime() and p.parseTypeExpr() and blk_1: { |
| 852 | | const pos_1 = p.i; |
| 853 | | const match_1 = p.parseExprSuffix(); |
| 854 | | p.i = pos_1; |
| 855 | | break :blk_1 !match_1; |
| 856 | | }) break :blk_0 true; |
| 765 | if (p.parseKEYWORD_comptime() and p.parseTypeExpr()) break :blk_0 true; |
| 857 | 766 | p.i = pos_0; |
| 858 | 767 | if (p.parseKEYWORD_error() and p.parseDOT() and p.parseIDENTIFIER()) break :blk_0 true; |
| 859 | 768 | p.i = pos_0; |
| ... | ... | @@ -907,12 +816,7 @@ const Parser = struct { |
| 907 | 816 | if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseTypeExpr()) break :blk_3 true; |
| 908 | 817 | p.i = pos_3; |
| 909 | 818 | break :blk_3 false; |
| 910 | | } or true) and blk_1: { |
| 911 | | const pos_1 = p.i; |
| 912 | | const match_1 = p.parseExprSuffix(); |
| 913 | | p.i = pos_1; |
| 914 | | break :blk_1 !match_1; |
| 915 | | }) break :blk_0 true; |
| 819 | } or true)) break :blk_0 true; |
| 916 | 820 | p.i = pos_0; |
| 917 | 821 | break :blk_0 false; |
| 918 | 822 | }; |
| ... | ... | @@ -959,11 +863,6 @@ const Parser = struct { |
| 959 | 863 | }) break :blk_2 true; |
| 960 | 864 | p.i = pos_2; |
| 961 | 865 | break :blk_2 false; |
| 962 | | } and blk_1: { |
| 963 | | const pos_1 = p.i; |
| 964 | | const match_1 = p.parseExprSuffix(); |
| 965 | | p.i = pos_1; |
| 966 | | break :blk_1 !match_1; |
| 967 | 866 | }) break :blk_0 true; |
| 968 | 867 | p.i = pos_0; |
| 969 | 868 | break :blk_0 false; |
| ... | ... | @@ -977,12 +876,7 @@ const Parser = struct { |
| 977 | 876 | if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseTypeExpr()) break :blk_3 true; |
| 978 | 877 | p.i = pos_3; |
| 979 | 878 | break :blk_3 false; |
| 980 | | } or true) and blk_1: { |
| 981 | | const pos_1 = p.i; |
| 982 | | const match_1 = p.parseExprSuffix(); |
| 983 | | p.i = pos_1; |
| 984 | | break :blk_1 !match_1; |
| 985 | | }) break :blk_0 true; |
| 879 | } or true)) break :blk_0 true; |
| 986 | 880 | p.i = pos_0; |
| 987 | 881 | break :blk_0 false; |
| 988 | 882 | }; |
| ... | ... | @@ -1643,44 +1537,6 @@ const Parser = struct { |
| 1643 | 1537 | break :blk_0 false; |
| 1644 | 1538 | }; |
| 1645 | 1539 | } |
| 1646 | | pub fn parseExprSuffix(p: *Parser) bool { |
| 1647 | | return blk_0: { |
| 1648 | | const pos_0 = p.i; |
| 1649 | | if (p.parseKEYWORD_or()) break :blk_0 true; |
| 1650 | | p.i = pos_0; |
| 1651 | | if (p.parseKEYWORD_and()) break :blk_0 true; |
| 1652 | | p.i = pos_0; |
| 1653 | | if (p.parseCompareOp()) break :blk_0 true; |
| 1654 | | p.i = pos_0; |
| 1655 | | if (p.parseBitwiseOp()) break :blk_0 true; |
| 1656 | | p.i = pos_0; |
| 1657 | | if (p.parseBitShiftOp()) break :blk_0 true; |
| 1658 | | p.i = pos_0; |
| 1659 | | if (p.parseAdditionOp()) break :blk_0 true; |
| 1660 | | p.i = pos_0; |
| 1661 | | if (p.parseMultiplyOp()) break :blk_0 true; |
| 1662 | | p.i = pos_0; |
| 1663 | | if (p.parseEXCLAMATIONMARK()) break :blk_0 true; |
| 1664 | | p.i = pos_0; |
| 1665 | | if (p.parseSuffixOp()) break :blk_0 true; |
| 1666 | | p.i = pos_0; |
| 1667 | | if (p.parseFnCallArguments()) break :blk_0 true; |
| 1668 | | p.i = pos_0; |
| 1669 | | break :blk_0 false; |
| 1670 | | }; |
| 1671 | | } |
| 1672 | | pub fn parseLabelableExpr(p: *Parser) bool { |
| 1673 | | return blk_0: { |
| 1674 | | const pos_0 = p.i; |
| 1675 | | if (p.parseBlock()) break :blk_0 true; |
| 1676 | | p.i = pos_0; |
| 1677 | | if (p.parseSwitchExpr()) break :blk_0 true; |
| 1678 | | p.i = pos_0; |
| 1679 | | if (p.parseLoopExpr()) break :blk_0 true; |
| 1680 | | p.i = pos_0; |
| 1681 | | break :blk_0 false; |
| 1682 | | }; |
| 1683 | | } |
| 1684 | 1540 | pub fn parseSliceTypeStart(p: *Parser) bool { |
| 1685 | 1541 | return blk_0: { |
| 1686 | 1542 | const pos_0 = p.i; |