Sha256: 8329592f11ca52123e5cd73928cefc991420181dd2cd4f5e42462e893b743087

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

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

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.0 lib/kaiser_ruby.rb