MCPcopy Index your code
hub / github.com/nodejs/node / parse_subscribed

Method parse_subscribed

tools/inspector_protocol/jinja2/parser.py:722–751  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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')

Callers 1

parse_subscriptMethod · 0.95

Calls 3

parse_expressionMethod · 0.95
nextFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected