def generate_lambda_string(document, optimize: false)
      @document = document
      @buff = []
      @indent = 0
      @code_indent = 0
      @optimize = optimize

      buff_code '# frozen_string_literal: true' # so it can be faster on Ruby 2.3+
      buff_code ''
      buff_code "lambda do |#{NEW_LINE_NAME}: \"\\n\", #{BASE_INDENT_NAME}: '  '|"

      code_indent do
        buff_code "self.#{NEW_LINE_NAME} = #{NEW_LINE_NAME}"
        buff_code "self.#{BASE_INDENT_NAME} = #{BASE_INDENT_NAME}"

        visit_document(document)

        buff_code "output = #{BUFF_NAME}.join"
        buff_code 'self.__reset'
        buff_code 'output'
      end

      buff_code 'end'


      @document = nil

      @buff.join("\n")
    end
def generate_lambda_string(document, optimize: false)
      @document = document
      @buff = []
      @indent = 0
      @code_indent = 0
      @optimize = optimize

      buff_code '# frozen_string_literal: true' # so it can be faster on Ruby 2.3+
      buff_code ''
      buff_code "lambda do |#{NEW_LINE_NAME}: \"\\n\", #{BASE_INDENT_NAME}: '  '|"

      code_indent do
        buff_code "self.#{NEW_LINE_NAME} = #{NEW_LINE_NAME}"
        buff_code "self.#{BASE_INDENT_NAME} = #{BASE_INDENT_NAME}"

        visit_document(document)

        buff_code "output = #{BUFF_NAME}.join"
        buff_code 'self.__reset'
        buff_code 'output'
      end

      buff_code 'end'


      @document = nil

      @buff.join("\n")
    end
@param [Bade::AST::Document] document

 @return [String] string to parse with Ruby