Sha256: 333ed3fc3aa3e20eb8791ed1a2800b016a55620a1056a106b5689d8c651c9714
Contents?: true
Size: 552 Bytes
Versions: 4
Compression:
Stored size: 552 Bytes
Contents
#!/Users/ryan/.rubies/ruby-2.7.1/bin/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
4 entries across 4 versions & 1 rubygems