Sha256: cd9da260af13c49549ce709d82df9b7a5533b59435be08bae9b26e4db7e70b9a

Contents?: true

Size: 530 Bytes

Versions: 26

Compression:

Stored size: 530 Bytes

Contents

#!/usr/bin/env ruby -ws

$d ||= false
$p ||= false

require "ripper/sexp"
require "pp" if $p

if ARGV.empty? then
  warn "reading from stdin"
  ARGV << "-"
end

class MySexpBuilder < Ripper::SexpBuilderPP
  def on_parse_error msg
    Kernel.warn msg
  end
end

ARGV.each do |path|
  src = path == "-" ? $stdin.read : File.read(path)
  rip = MySexpBuilder.new src
  rip.yydebug = $d

  sexp = rip.parse

  if rip.error? then
    warn "skipping"
    next
  end

  puts "accept"

  if $p then
    pp sexp
  else
    p sexp
  end
end

Version data entries

26 entries across 23 versions & 3 rubygems

Version Path
ruby_parser-3.17.0 tools/ripper.rb
brakeman-5.0.2 bundle/ruby/2.7.0/gems/ruby_parser-3.16.0/tools/ripper.rb
ruby_parser-3.16.0 tools/ripper.rb
brakeman-5.0.0 bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/tools/ripper.rb
ruby_parser-3.15.1 tools/ripper.rb
brakeman-4.10.1 bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/tools/ripper.rb
brakeman-5.0.0.pre1 bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/tools/ripper.rb
brakeman-4.10.0 bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/tools/ripper.rb
brakeman-4.9.1 bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/tools/ripper.rb
ruby_parser-3.15.0 tools/ripper.rb
brakeman-4.9.0 bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/tools/ripper.rb
brakeman-4.8.2 bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/tools/ripper.rb
brakeman-4.8.1 bundle/ruby/2.4.0/gems/ruby_parser-3.14.2/tools/ripper.rb
brakeman-4.8.0 bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/tools/ripper.rb
ruby_parser-3.14.2 tools/ripper.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/tools/ripper.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.2/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/tools/ripper.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/tools/ripper.rb
brakeman-4.7.2 bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/tools/ripper.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/tools/ripper.rb