class_docstr: Lexer for Typographic Number Theory, as described in the book
  Gödel, Escher, Bach, by Douglas R. Hofstadter
  
  .. versionadded:: 2.7
class_docstr_tok: ["Lexer","for","Typographic","Number","Theory",",","as","described","in","the","book","G\u00f6del",",","Escher",",","Bach",",","by","Douglas","R.","Hofstadter","..","versionadded",":",":","2.7"]
docstr: Tokenize a term.
docstr_tok: ["Tokenize","a","term","."]
code: def term(self, start, text):
      """Tokenize a term."""
      if text[start] == "S":  # S...S(...) or S...0
          end = start + 1
          while text[end] == "S":
              end += 1
          self.cur.append((start, Number.Integer, text[start:end]))
          return self.term(end, text)
      if text[start] == "0":  # the singleton 0
          self.cur.append((start, Number.Integer, text[start]))
          return start + 1
      if text[start] in self.VARIABLES:  # a''...
          return self.variable(start, text)
      if text[start] == "(":  # (...+...)
          self.cur.append((start, Punctuation, text[start]))
          start = self.term(start + 1, text)
          if text[start] not in self.OPERATORS:
              raise AssertionError
          self.cur.append((start, Operator, text[start]))
          start = self.term(start + 1, text)
          if text[start] != ")":
              raise AssertionError
          self.cur.append((start, Punctuation, text[start]))
          return start + 1
      raise AssertionError
  
file_path: catboost/contrib/python/Pygments/py3/pygments/lexers/tnt.py
imports: import re
  from pygments.lexer import Lexer
  from pygments.token import Text, Comment, Operator, Keyword, Name, Number, Punctuation, Error
label_desc: Use image node_id 4 for calling the TNTLexer obj's underlying member method code with example usage: obj.term(start, text) and returns: self, unknown, self, unknown