summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.5.2/lib/rouge/formatters/null.rb
blob: 078c461ca9c150a31d4f7d9f9c761ce5b7185c76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
  module Formatters
    # A formatter which renders nothing.
    class Null < Formatter
      tag 'null'

      def initialize(*)
      end

      def stream(tokens, &b)
        tokens.each do |tok, val|
          yield "#{tok.qualname} #{val.inspect}\n"
        end
      end
    end
  end
end