MCPcopy Create free account
hub / github.com/numpy/numpy / parse_cond

Function parse_cond

numpy/_build_utils/tempita/_tempita.py:814–824  ·  view source on GitHub ↗
(tokens, name, context)

Source from the content-addressed store, hash-verified

812
813
814def parse_cond(tokens, name, context):
815 start = tokens[0][1]
816 pieces = []
817 context = context + ("if",)
818 while 1:
819 if not tokens:
820 raise TemplateError("Missing {{endif}}", position=start, name=name)
821 if isinstance(tokens[0], tuple) and tokens[0][0] == "endif":
822 return ("cond", start) + tuple(pieces), tokens[1:]
823 next_chunk, tokens = parse_one_cond(tokens, name, context)
824 pieces.append(next_chunk)
825
826
827def parse_one_cond(tokens, name, context):

Callers 1

parse_exprFunction · 0.85

Calls 2

TemplateErrorClass · 0.85
parse_one_condFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…