MCPcopy Create free account
hub / github.com/nodejs/node / next_if

Method next_if

deps/v8/third_party/jinja2/lexer.py:365–372  ·  view source on GitHub ↗

Perform the token test and return the token if it matched. Otherwise the return value is `None`.

(self, expr: str)

Source from the content-addressed store, hash-verified

363 next(self)
364
365 def next_if(self, expr: str) -> t.Optional[Token]:
366 """Perform the token test and return the token if it matched.
367 Otherwise the return value is `None`.
368 """
369 if self.current.test(expr):
370 return next(self)
371
372 return None
373
374 def skip_if(self, expr: str) -> bool:
375 """Like :meth:`next_if` but only returns `True` or `False`."""

Callers 2

skip_ifMethod · 0.95
parseMethod · 0.45

Calls 2

nextFunction · 0.50
testMethod · 0.45

Tested by

no test coverage detected