(self)
| 828 | self.fail("expected subscript expression", token.lineno) |
| 829 | |
| 830 | def parse_subscribed(self) -> nodes.Expr: |
| 831 | lineno = self.stream.current.lineno |
| 832 | args: t.List[t.Optional[nodes.Expr]] |
| 833 | |
| 834 | if self.stream.current.type == "colon": |
| 835 | next(self.stream) |
| 836 | args = [None] |
| 837 | else: |
| 838 | node = self.parse_expression() |
| 839 | if self.stream.current.type != "colon": |
| 840 | return node |
| 841 | next(self.stream) |
| 842 | args = [node] |
| 843 | |
| 844 | if self.stream.current.type == "colon": |
| 845 | args.append(None) |
| 846 | elif self.stream.current.type not in ("rbracket", "comma"): |
| 847 | args.append(self.parse_expression()) |
| 848 | else: |
| 849 | args.append(None) |
| 850 | |
| 851 | if self.stream.current.type == "colon": |
| 852 | next(self.stream) |
| 853 | if self.stream.current.type not in ("rbracket", "comma"): |
| 854 | args.append(self.parse_expression()) |
| 855 | else: |
| 856 | args.append(None) |
| 857 | else: |
| 858 | args.append(None) |
| 859 | |
| 860 | return nodes.Slice(lineno=lineno, *args) |
| 861 | |
| 862 | def parse_call_args(self) -> t.Tuple: |
| 863 | token = self.stream.expect("lparen") |
no test coverage detected