Sha256: c9337e750242cb35f9163b17ef3375ba110ee215335eeccd2bdf4132e2fc1963
Contents?: true
Size: 772 Bytes
Versions: 2
Compression:
Stored size: 772 Bytes
Contents
require 'duby' module Duby class NbCompiler include org.jruby.duby.DubyCompiler class ParseResult ParseError = org.jruby.duby.ParseError include org.jruby.duby.ParseResult attr_reader :ast, :errors def initialize(ast, errors) @ast = ast parse_errors = errors.map do |error| ParseError.new(error.message, error.position) end @errors = parse_errors.to_java(ParseError) end end def parse(text) Duby::AST.type_factory = Duby::JVM::Types::TypeFactory.new ast = Duby::AST.parse_ruby(text) transformer = Duby::Transform::Transformer.new return ParseResult.new( transformer.transform(ast, nil), transformer.errors) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
duby-0.0.2-java | lib/duby/nbcompiler.rb |
duby-0.0.1 | lib/duby/nbcompiler.rb |