def process_token(self, tok):
if tok[<NUM_LIT:0>] == Token.Text:<EOL><INDENT>count = tok[<NUM_LIT:1>].count('<STR_LIT:\n>')<EOL>if count:<EOL><INDENT>self._line += count  <EOL><DEDENT><DEDENT>if self._detector.process(tok):<EOL><INDENT>pass  <EOL><DEDENT>elif tok[<NUM_LIT:0>] == Token.Punctuation:<EOL><INDENT>if tok[<NUM_LIT:0>] == Token.Punctuation and tok[<NUM_LIT:1>] == '<STR_LIT:{>':<EOL><INDENT>self._scope += <NUM_LIT:1><EOL><DEDENT>if tok[<NUM_LIT:0>] == Token.Punctuation and tok[<NUM_LIT:1>] == '<STR_LIT:}>':<EOL><INDENT>self._scope += -<NUM_LIT:1><EOL>if self._scope == <NUM_LIT:0> and self._curr is not None:<EOL><INDENT>self._curr['<STR_LIT:end>'] = self._line  <EOL>self._curr = None<EOL><DEDENT><DEDENT><DEDENT>elif tok[<NUM_LIT:0>] == Token.Name.Class and self._scope == <NUM_LIT:0>:<EOL><INDENT>self.add_scope('<STR_LIT>', tok[<NUM_LIT:1>], self._line)<EOL><DEDENT>elif tok[<NUM_LIT:0>] == Token.Name.Function and self._scope in [<NUM_LIT:0>, <NUM_LIT:1>]:<EOL><INDENT>self.add_scope('<STR_LIT>', tok[<NUM_LIT:1>], self._line, self._scope == <NUM_LIT:1>)<EOL><DEDENT>
count lines and track position of classes and functions