| 72 | | #XXX shouldn't need this, it should all be in GLOBAL:: or the current package hash |
| 73 | | |
| 74 | | my @typenames = ( # (need parens for gimme5 translator) |
| 75 | | <Void Bit Int UInt Str Num Complex Bool True False Rat>, |
| 76 | | <Exception Code Block List Seq Range Set Bag Junction Pair>, |
| 77 | | <Mapping Signature Capture Blob Whatever Undef Failure>, |
| 78 | | <StrPos StrLen Version P6opaque>, |
| 79 | | <bit int int8 int16 int32 uint uint8 uint16 uint32 buf buf8 buf16 buf32 num complex bool rat>, |
| 80 | | <Scalar Array Hash KeyHash KeySet KeyBag Buf IO Routine Sub Method>, |
| 81 | | <Submethod Macro Regex Match Package Module Class Role Grammar Any Object>, |
| 82 | | () |
| 83 | | ); |
| | 72 | # XXX shouldn't need this, it should all be defined/imported by the prelude |
| | 73 | |
| | 74 | my @typenames = qw[ |
| | 75 | Object Any Junction Whatever |
| | 76 | Capture Match Signature |
| | 77 | Package Module Class Role Grammar |
| | 78 | Scalar Array Hash KeyHash KeySet KeyBag |
| | 79 | Pair List Seq Range Set Bag Mapping |
| | 80 | Void Undef Failure Exception |
| | 81 | Code Block Routine Sub Macro |
| | 82 | Method Submethod Regex |
| | 83 | |
| | 84 | Str Blob |
| | 85 | Char Byte Codepoint Grapheme StrPos StrLen Version |
| | 86 | |
| | 87 | Num Complex |
| | 88 | num complex |
| | 89 | |
| | 90 | Int int int1 int2 int4 int8 int16 int32 int64 |
| | 91 | Rat rat rat1 rat2 rat4 rat8 rat16 rat32 rat64 |
| | 92 | Uint uint uint1 uint2 uint4 uint8 uint16 uint32 uint64 |
| | 93 | Buf buf buf1 buf2 buf4 buf8 buf16 buf32 buf64 |
| | 94 | |
| | 95 | Bit Bool True False |
| | 96 | bit bool |
| | 97 | |
| | 98 | Order Increasing Decreasing |
| | 99 | Ordered Callable Positional Associatve |
| | 100 | Ordering KeyExtractor Comparator OrderingPair |
| | 101 | |
| | 102 | IO |
| | 103 | |
| | 104 | KitchenSink |
| | 105 | ]; |
| | 106 | |
| 1715 | | :my $lang = $l; |
| 1716 | | :my $start; |
| 1717 | | :my $stop; |
| 1718 | | |
| 1719 | | <.ws> |
| 1720 | | [ <quotepair> <.ws> |
| 1721 | | { |
| 1722 | | my $kv = $<quotepair>[*-1]; |
| 1723 | | $lang = $lang.tweak($kv.<k>, $kv.<v>) |
| 1724 | | or self.panic("Unrecognized adverb :" ~ $kv.<k> ~ '(' ~ $kv.<v> ~ ')'); |
| 1725 | | } |
| 1726 | | ]* |
| 1727 | | |
| 1728 | | { ($start,$stop) = $¢.peek_delimiters(); } |
| 1729 | | |
| | 1738 | :my ($lang, $start, $stop); |
| | 1739 | <babble($l)> |
| | 1740 | { my $B = $<babble><B>; ($lang,$start,$stop) = @$B; } |
| | 1741 | |
| | 1742 | $start <left=nibble($lang)> $stop |
| 1741 | | :my $lang = $l; |
| 1742 | | :my $start; |
| 1743 | | :my $stop; |
| 1744 | | |
| 1745 | | <.ws> |
| 1746 | | [ <quotepair> <.ws> |
| 1747 | | { |
| 1748 | | my $kv = $<quotepair>[*-1]; |
| 1749 | | $lang = $lang.tweak($kv.<k>, $kv.<v>) |
| 1750 | | or self.panic("Unrecognized adverb :" ~ $kv.<k> ~ '(' ~ $kv.<v> ~ ')'); |
| 1751 | | } |
| 1752 | | ]* |
| 1753 | | |
| 1754 | | { |
| 1755 | | ($start,$stop) = $¢.peek_delimiters(); |
| 1756 | | $lang = $start ne $stop ?? $lang.balanced($start,$stop) |
| 1757 | | !! $lang.unbalanced($stop); |
| 1758 | | } |
| 1759 | | |
| | 1755 | :my ($lang, $start, $stop); |
| | 1756 | <babble($l)> |
| | 1757 | { my $B = $<babble><B>; ($lang,$start,$stop) = @$B; } |
| | 1758 | |
| | 1759 | $start <left=nibble($lang)> $stop |
| 1771 | | :my $lang = $l; |
| 1772 | | :my $start; |
| 1773 | | :my $stop; |
| 1774 | | |
| 1775 | | <.ws> |
| 1776 | | [ <quotepair> <.ws> |
| 1777 | | { |
| 1778 | | my $kv = $<quotepair>[*-1]; |
| 1779 | | $lang = $lang.tweak($kv.<k>, $kv.<v>) |
| 1780 | | or self.panic("Unrecognized adverb :" ~ $kv.<k> ~ '(' ~ $kv.<v> ~ ')'); |
| 1781 | | } |
| 1782 | | ]* |
| 1783 | | |
| 1784 | | { |
| 1785 | | ($start,$stop) = $¢.peek_delimiters(); |
| 1786 | | $lang = $start ne $stop ?? $lang.balanced($start,$stop) |
| 1787 | | !! $lang.unbalanced($stop); |
| 1788 | | } |
| | 1769 | :my ($lang, $start, $stop); |
| | 1770 | <babble($l)> |
| | 1771 | { my $B = $<babble><B>; ($lang,$start,$stop) = @$B; } |