(self)
| 720 | self.fail('expected subscript expression', self.lineno) |
| 721 | |
| 722 | def parse_subscribed(self): |
| 723 | lineno = self.stream.current.lineno |
| 724 | |
| 725 | if self.stream.current.type == 'colon': |
| 726 | next(self.stream) |
| 727 | args = [None] |
| 728 | else: |
| 729 | node = self.parse_expression() |
| 730 | if self.stream.current.type != 'colon': |
| 731 | return node |
| 732 | next(self.stream) |
| 733 | args = [node] |
| 734 | |
| 735 | if self.stream.current.type == 'colon': |
| 736 | args.append(None) |
| 737 | elif self.stream.current.type not in ('rbracket', 'comma'): |
| 738 | args.append(self.parse_expression()) |
| 739 | else: |
| 740 | args.append(None) |
| 741 | |
| 742 | if self.stream.current.type == 'colon': |
| 743 | next(self.stream) |
| 744 | if self.stream.current.type not in ('rbracket', 'comma'): |
| 745 | args.append(self.parse_expression()) |
| 746 | else: |
| 747 | args.append(None) |
| 748 | else: |
| 749 | args.append(None) |
| 750 | |
| 751 | return nodes.Slice(lineno=lineno, *args) |
| 752 | |
| 753 | def parse_call(self, node): |
| 754 | token = self.stream.expect('lparen') |
no test coverage detected