-
-
Save baroquebobcat/2649876 to your computer and use it in GitHub Desktop.
Blog post notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| m> x = 1 | |
| m> puts X |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment