Sha256: f428a3dae56eac9c1c12e1f2a1078e9ab02867faa0f7dd2ea19f56dab07bf167

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

# Require current parser without warnings
save_verbose, $VERBOSE = $VERBOSE, nil
require "parser/current"
$VERBOSE = save_verbose

require "unparser"

# Unparser patches

# Unparser doesn't support endless ranges
# Source: https://github.com/mbj/unparser/blob/a4f959d58b660ef0630659efa5882fc20936eb18/lib/unparser/emitter/literal/range.rb
# TODO: propose a PR
class Unparser::Emitter::Literal::Range
  private

  def dispatch
    visit(begin_node)
    write(TOKENS.fetch(node.type))
    visit(end_node) unless end_node.nil?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-next-0.1.1 lib/ruby-next/language/unparser.rb
ruby-next-0.1.0 lib/ruby-next/language/unparser.rb