class_docstr: Lexer for terraformi ``.tf`` files.
  
  .. versionadded:: 2.1
class_docstr_tok: ["Lexer","for","terraformi","``",".tf","``","files",".","..","versionadded",":",":","2.1"]
code: def heredoc_callback(self, match, ctx):
      # Parse a terraform heredoc
      # match: 1 = <<[-]?, 2 = name 3 = rest of line
  
      start = match.start(1)
      yield start, Operator, match.group(1)  # <<[-]?
      yield match.start(2), String.Delimiter, match.group(
          2
      )  # heredoc name
  
      ctx.pos = match.start(3)
      ctx.end = match.end(3)
      yield ctx.pos, String.Heredoc, match.group(3)
      ctx.pos = match.end()
  
      hdname = match.group(2)
      tolerant = True  # leading whitespace is always accepted
  
      lines = []
  
      for match in line_re.finditer(ctx.text, ctx.pos):
          if tolerant:
              check = match.group().strip()
          else:
              check = match.group().rstrip()
          if check == hdname:
              for amatch in lines:
                  yield amatch.start(), String.Heredoc, amatch.group()
              yield match.start(), String.Delimiter, match.group()
              ctx.pos = match.end()
              break
          else:
              lines.append(match)
      else:
          # end of heredoc not found -- error!
          for amatch in lines:
              yield amatch.start(), Error, amatch.group()
      ctx.end = len(ctx.text)
  
imports: import re
  from pygments.lexer import ExtendedRegexLexer, RegexLexer, default, words, bygroups, include, using, line_re
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Punctuation, Whitespace, Literal, Error, Generic
  from pygments.lexers.shell import BashLexer
  from pygments.lexers.data import JsonLexer
label_desc: Use image node_id 1 for calling the TerraformLexer obj's underlying member method code with example usage: obj.heredoc_callback(match, ctx) without return types