class_docstr: Base class for all lexers.
docstr: Takes a :class:`~prompt_toolkit.document.Document` and returns a
  callable that takes a line number and returns the tokens for that line.
docstr_tok: ["Takes","a",":","class",":","`","~prompt_toolkit.document.Document","`","and","returns","a","callable","that","takes","a","line","number","and","returns","the","tokens","for","that","line","."]
code: def lex_document(self, cli, document):
      """
      Takes a :class:`~prompt_toolkit.document.Document` and returns a
      callable that takes a line number and returns the tokens for that line.
      """
  
imports: from __future__ import unicode_literals
  from abc import ABCMeta, abstractmethod
  from six import with_metaclass
  from six.moves import range
  from prompt_toolkit.token import Token
  from prompt_toolkit.filters import to_cli_filter
  from .utils import split_lines
  import re
  import six
label_desc: Use image node_id 1 for calling the Lexer obj's underlying member method code with example usage: obj.lex_document(cli, document) without return types