Sha256: a09b248d6d2afa240b71f484401e7619b397106667c1e6396743c0a02d229933

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require 'parslet'
require 'kaiser_ruby/rockstar_parser'
require 'kaiser_ruby/rockstar_transform'

module KaiserRuby
  def self.parse(input)
    if input.split("\n").size == 1
      KaiserRuby::RockstarSingleLineParser.new.parse(input.chomp)
    else
      KaiserRuby::RockstarParser.new.parse(input)
    end
  rescue Parslet::ParseFailed => failure
    puts input.inspect
    puts failure.parse_failure_cause.ascii_tree
  end

  def self.transform(tree)
    KaiserRuby::RockstarTransform.new.apply(tree)
  end

  def self.transpile(input)
    transform(parse(input))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kaiser-ruby-0.2.1 lib/kaiser_ruby.rb