module Gammo::Tokenizer::Debug::ClassMethods

Public Instance Methods

map() click to toggle source
# File lib/gammo/tokenizer/debug.rb, line 28
def map
  @map ||= {}
end
method_added(method) click to toggle source
# File lib/gammo/tokenizer/debug.rb, line 13
        def method_added(method)
          name = method.to_s
          return if %w[debug _debugged ?].any?(&name.method(:end_with?))
          return unless name.start_with?('scan_')
          return if map[method]
          map[method] = true
          alias_method :"#{name}_debugged", method
          class_eval <<-EOS
            def #{method}
              debug "#{method}, \#{scanner.string[scanner.pos]}"
              #{method}_debugged
            end
          EOS
        end