Permalink
Browse files

an initial fix of main problem, but it's kind of ugly.

  • Loading branch information...
baroquebobcat committed Aug 2, 2011
1 parent de68299 commit 487779fc74e809edf109e3fb65b650269d2e2bf3
Showing with 13 additions and 2 deletions.
  1. +11 −1 lib/mirah/jvm/compiler/java_source.rb
  2. +2 −1 lib/mirah/jvm/source_generator/builder.rb
@@ -56,7 +56,17 @@ def file_builder(filename)
def output_type
"source files"
end
def define_class(class_def, expression)
with(:type => class_def.inferred_type,
:class => class_def.inferred_type.define(@file),
:static => false) do
annotate(@class, class_def.annotations)
class_def.body.compile(self, false) if class_def.body
@class.stop unless @method && @method.name == 'main' && @class == @method.klass
end
end
def define_method(node)
base_define_method(node, false) do |method, _|
with :method => method do
@@ -341,10 +341,11 @@ def build_method(name, visibility, static, exceptions, type, *args)
class MethodBuilder
include Helper
attr_accessor :name, :type, :out
attr_accessor :name, :type, :out, :klass
def initialize(cls, options)
@class = cls
@klass = cls
@compiler = cls.compiler
@out = Output.new
@visibility = options[:visibility]

0 comments on commit 487779f

Please sign in to comment.