Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created May 9, 2012 23:51
Show Gist options
  • Select an option

  • Save baroquebobcat/2649876 to your computer and use it in GitHub Desktop.

Select an option

Save baroquebobcat/2649876 to your computer and use it in GitHub Desktop.
Blog post notes
$ mirahc --java Macros.mirah
Parsing...
Macros.mirah
Inferring types...
Compiling...
Macros.mirah
Macros.mirah:15: undefined method `block' for nil:NilClass
attr_reader :foo
^^^^^^^^^^^^^^^^^^
Mirah::InternalCompilerError: undefined method `block' for nil:NilClass
compile at mirah-0.0.11-java/lib/mirah/compiler/structure.rb:32
send at org/jruby/RubyKernel.java:2084
begin
ast = parser.parse_and_transform 'RePl'+Time.now.to_i.to_s, buffer
rescue Mirah::SyntaxError => e
if e.message =~ /expected \w+ before '<EOF>'/
next
else
raise e
end
rescue NameError => e
puts e
next
end
def scoped_body(scope, expression)
if @method
@method.block do
super
end
else
super
end
end
# https://github.com/mirah/mirah/blob/6ec73388100c8132440a08526a56248475c8ff72/lib/mirah/jvm/compiler/java_source.rb#L361-369
def scoped_body(scope, expression)
@method.block do
super
end
end
# https://github.com/mirah/mirah/blob/6b058459b9ea95b2d224003adef38afca23c751b/lib/mirah/jvm/compiler/java_source.rb#L361-365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment