Sha256: c9d5eb0350e717e924233aaf88dd0f1b9d1956bdc34f1921a33384a9c321855d
Contents?: true
Size: 756 Bytes
Versions: 18
Compression:
Stored size: 756 Bytes
Contents
#!/usr/bin/env ruby -ws $b ||= false # bug mode -- ripper is buggy, use Ripper.sexp $d ||= false # debug -- turn on yydebug $p ||= false # Use pp 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) sexp = if $b then Ripper.sexp src else rip = MySexpBuilder.new src rip.yydebug = $d rip.parse if rip.error? then warn "skipping" next end end puts "accept" if $p then pp sexp else p sexp end end
Version data entries
18 entries across 18 versions & 2 rubygems