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

Method parse_subscribed

deps/v8/third_party/jinja2/parser.py:830–860  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 1

parse_subscriptMethod · 0.95

Calls 3

parse_expressionMethod · 0.95
nextFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected