MCPcopy Index your code
hub / github.com/python/cpython / tokeneater

Method tokeneater

Lib/idlelib/editor.py:1592–1603  ·  view source on GitHub ↗
(self, type, token, start, end, line,
                   INDENT=tokenize.INDENT,
                   NAME=tokenize.NAME,
                   OPENERS=('class', 'def', 'for', 'if', 'match', 'try',
                            'while', 'with'))

Source from the content-addressed store, hash-verified

1590 return self.text.get(mark, mark + " lineend+1c")
1591
1592 def tokeneater(self, type, token, start, end, line,
1593 INDENT=tokenize.INDENT,
1594 NAME=tokenize.NAME,
1595 OPENERS=('class', 'def', 'for', 'if', 'match', 'try',
1596 'while', 'with')):
1597 if self.finished:
1598 pass
1599 elif type == NAME and token in OPENERS:
1600 self.blkopenline = line
1601 elif type == INDENT and self.blkopenline:
1602 self.indentedline = line
1603 self.finished = 1
1604
1605 def run(self):
1606 """Return 2 lines containing block opener and indent.

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected