mirah 0.0.12-java → 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +372 -0
- data/README.txt +4 -5
- data/Rakefile +178 -55
- data/examples/appengine/Readme +3 -3
- data/examples/appengine/src/org/mirah/MirahApp.mirah +1 -1
- data/examples/appengine/src/org/mirah/list.dhtml +1 -1
- data/examples/bintrees.mirah +1 -1
- data/examples/edb.mirah +1 -1
- data/examples/fib.mirah +1 -1
- data/examples/interfaces.mirah +1 -1
- data/examples/macros/{string-each-char.mirah → string_each_char.mirah} +4 -5
- data/examples/maven/README.txt +1 -1
- data/examples/maven/src/main/mirah/hello_mirah.mirah +1 -1
- data/examples/plugins/appengine/Rakefile +1 -1
- data/examples/plugins/appengine/src/com/google/appengine/ext/duby/db/MetaModel.mirah +1 -1
- data/examples/plugins/appengine/src/com/google/appengine/ext/duby/db/Model.duby +1 -1
- data/examples/plugins/appengine/test/com/google/appengine/ext/duby/db/ModelTest.duby +1 -1
- data/examples/rosettacode/100-doors.mirah +6 -6
- data/examples/rosettacode/README.txt +3 -3
- data/examples/rosettacode/boolean-values.mirah +1 -1
- data/examples/rosettacode/comments.mirah +1 -1
- data/examples/rosettacode/count-occurrences-of-a-substring.mirah +1 -1
- data/examples/rosettacode/factorial.mirah +1 -1
- data/examples/rosettacode/fibonacci.mirah +1 -1
- data/examples/rosettacode/fizz-buzz.mirah +2 -2
- data/examples/rosettacode/flatten-a-list.mirah +4 -4
- data/examples/rosettacode/guess-the-number.mirah +2 -2
- data/examples/rosettacode/hamming-numbers.mirah +4 -4
- data/examples/rosettacode/is-string-numeric.mirah +22 -22
- data/examples/rosettacode/palindrome.mirah +2 -2
- data/examples/rosettacode/random-numbers.mirah +1 -1
- data/examples/rosettacode/repeat-a-string.mirah +1 -1
- data/examples/rosettacode/reverse-a-string.mirah +1 -1
- data/examples/rosettacode/rot-13.mirah +5 -5
- data/examples/rosettacode/secure-temporary-file.mirah +2 -2
- data/examples/rosettacode/sleep.mirah +1 -1
- data/examples/rosettacode/string-length.mirah +5 -5
- data/examples/swing.mirah +1 -1
- data/examples/test.edb +1 -1
- data/javalib/mirah-bootstrap.jar +0 -0
- data/javalib/mirah-builtins.jar +0 -0
- data/javalib/mirah-parser.jar +0 -0
- data/javalib/mirah-util.jar +0 -0
- data/lib/duby.rb +1 -1
- data/lib/mirah.rb +50 -28
- data/lib/mirah/ast.rb +15 -605
- data/lib/mirah/ast/scope.rb +98 -69
- data/lib/mirah/commands.rb +1 -1
- data/lib/mirah/commands/base.rb +7 -7
- data/lib/mirah/commands/compile.rb +3 -3
- data/lib/mirah/commands/parse.rb +7 -5
- data/lib/mirah/commands/run.rb +12 -19
- data/lib/mirah/compiler.rb +15 -23
- data/lib/mirah/errors.rb +16 -1
- data/lib/mirah/generator.rb +79 -39
- data/lib/mirah/jvm/compiler.rb +1 -19
- data/lib/mirah/jvm/compiler/base.rb +233 -90
- data/lib/mirah/jvm/compiler/jvm_bytecode.rb +675 -363
- data/lib/mirah/jvm/method_lookup.rb +134 -65
- data/lib/mirah/jvm/typer.rb +10 -5
- data/lib/mirah/jvm/types.rb +10 -2
- data/lib/mirah/jvm/types/array_type.rb +10 -12
- data/lib/mirah/{compiler/type.rb → jvm/types/ast_ext.rb} +12 -8
- data/lib/mirah/jvm/types/basic_types.rb +26 -33
- data/lib/mirah/jvm/types/bitescript_ext.rb +1 -1
- data/lib/mirah/jvm/types/block_type.rb +15 -0
- data/lib/mirah/jvm/types/boolean.rb +8 -4
- data/lib/mirah/jvm/types/dynamic_type.rb +12 -13
- data/lib/mirah/jvm/types/enumerable.rb +7 -7
- data/lib/mirah/jvm/types/extensions.rb +11 -6
- data/lib/mirah/jvm/types/factory.rb +624 -94
- data/lib/mirah/jvm/types/floats.rb +21 -15
- data/lib/mirah/jvm/types/generic_type.rb +72 -0
- data/lib/mirah/jvm/types/implicit_nil_type.rb +29 -0
- data/lib/mirah/jvm/types/integers.rb +26 -71
- data/lib/mirah/jvm/types/interface_definition.rb +3 -3
- data/lib/mirah/jvm/types/intrinsics.rb +203 -168
- data/lib/mirah/jvm/types/literals.rb +6 -6
- data/lib/mirah/jvm/types/meta_type.rb +13 -4
- data/lib/mirah/jvm/types/methods.rb +281 -93
- data/lib/mirah/jvm/types/null_type.rb +17 -5
- data/lib/mirah/jvm/types/number.rb +10 -7
- data/lib/mirah/jvm/types/primitive_type.rb +17 -6
- data/lib/mirah/jvm/types/source_mirror.rb +12 -7
- data/lib/mirah/jvm/types/type.rb +107 -23
- data/lib/mirah/jvm/types/type_definition.rb +25 -10
- data/lib/mirah/jvm/types/unreachable_type.rb +1 -1
- data/lib/mirah/jvm/types/void_type.rb +3 -3
- data/lib/mirah/parser.rb +154 -16
- data/lib/mirah/plugin/edb.rb +1 -1
- data/lib/mirah/transform.rb +1 -2
- data/lib/mirah/transform/ast_ext.rb +24 -43
- data/lib/mirah/transform/transformer.rb +29 -224
- data/lib/mirah/typer.rb +2 -16
- data/lib/mirah/util/argument_processor.rb +25 -10
- data/lib/mirah/util/class_loader.rb +1 -1
- data/lib/mirah/util/compilation_state.rb +16 -17
- data/lib/mirah/util/delegate.rb +2 -2
- data/lib/mirah/util/logging.rb +110 -0
- data/lib/mirah/util/process_errors.rb +69 -11
- data/lib/mirah/version.rb +1 -1
- data/test/core/commands_test.rb +6 -24
- data/test/core/env_test.rb +5 -5
- data/{lib/mirah/jvm/source_generator/typer.rb → test/core/generator_test.rb} +9 -9
- data/test/core/typer_test.rb +196 -158
- data/test/core/util/argument_processor_test.rb +10 -10
- data/test/core/util/class_loader_test.rb +6 -5
- data/test/fixtures/org/foo/LowerCaseInnerClass$inner.class +0 -0
- data/test/fixtures/org/foo/LowerCaseInnerClass.class +0 -0
- data/test/fixtures/org/foo/LowerCaseInnerClass.java +7 -0
- data/test/jvm/annotations_test.rb +5 -5
- data/test/jvm/blocks_test.rb +140 -88
- data/test/jvm/bytecode_test_helper.rb +112 -94
- data/test/jvm/cast_test.rb +162 -0
- data/test/jvm/constructors_test.rb +18 -8
- data/test/jvm/enumerable_test.rb +77 -44
- data/test/jvm/example_test.rb +53 -0
- data/test/jvm/factory_test.rb +7 -1
- data/test/jvm/generics_test.rb +57 -0
- data/test/jvm/hash_test.rb +106 -0
- data/test/jvm/import_test.rb +81 -0
- data/test/jvm/interface_test.rb +73 -0
- data/test/jvm/java_typer_test.rb +92 -66
- data/{lib/mirah/typer/base.rb → test/jvm/jvm_commands_test.rb} +6 -10
- data/test/jvm/jvm_compiler_test.rb +170 -604
- data/test/jvm/list_extensions_test.rb +23 -0
- data/test/jvm/macros_test.rb +197 -32
- data/test/jvm/main_method_test.rb +4 -4
- data/test/jvm/numeric_extensions_test.rb +13 -0
- data/test/jvm/rescue_test.rb +73 -16
- data/test/jvm/varargs_test.rb +65 -0
- data/test/test_helper.rb +1 -2
- metadata +234 -251
- data/examples/SortClosure$__xform_tmp_1.class +0 -0
- data/examples/SortClosure$__xform_tmp_2.class +0 -0
- data/examples/SortClosure.class +0 -0
- data/examples/macros/StringEachChar$Extension1.class +0 -0
- data/lib/mirah/ast/call.rb +0 -345
- data/lib/mirah/ast/class.rb +0 -359
- data/lib/mirah/ast/flow.rb +0 -381
- data/lib/mirah/ast/intrinsics.rb +0 -563
- data/lib/mirah/ast/literal.rb +0 -178
- data/lib/mirah/ast/local.rb +0 -112
- data/lib/mirah/ast/method.rb +0 -408
- data/lib/mirah/ast/structure.rb +0 -387
- data/lib/mirah/ast/type.rb +0 -146
- data/lib/mirah/commands/base.rb~ +0 -57
- data/lib/mirah/compiler/call.rb +0 -45
- data/lib/mirah/compiler/class.rb +0 -81
- data/lib/mirah/compiler/flow.rb +0 -109
- data/lib/mirah/compiler/literal.rb +0 -130
- data/lib/mirah/compiler/local.rb +0 -59
- data/lib/mirah/compiler/method.rb +0 -44
- data/lib/mirah/compiler/structure.rb +0 -65
- data/lib/mirah/jvm/compiler/java_source.rb +0 -787
- data/lib/mirah/jvm/method_lookup.rb~ +0 -247
- data/lib/mirah/jvm/source_generator/builder.rb +0 -468
- data/lib/mirah/jvm/source_generator/loops.rb +0 -131
- data/lib/mirah/jvm/source_generator/precompile.rb +0 -210
- data/lib/mirah/plugin/gwt.rb +0 -189
- data/lib/mirah/plugin/java.rb +0 -70
- data/lib/mirah/transform/error.rb +0 -13
- data/lib/mirah/transform/helper.rb +0 -765
- data/lib/mirah/typer/simple.rb +0 -384
- data/lib/mirah/version.rb~ +0 -18
- data/test/core/ast_test.rb +0 -382
- data/test/core/compilation_test.rb +0 -130
- data/test/core/macros_test.rb +0 -61
- data/test/jvm/javac_test_helper.rb +0 -89
- data/test/jvm/jvm_compiler_test.rb~ +0 -2181
- data/test/plugins/gwt_test.rb +0 -69
data/History.txt
CHANGED
@@ -1,3 +1,375 @@
|
|
1
|
+
=== 0.1.0 Steamboating / 2013-02-24
|
2
|
+
|
3
|
+
db38a8d make tests 1.6.8 compatible
|
4
|
+
57835f1 raise an error attempting to compile mirah using jruby before 1.7
|
5
|
+
ea04a51 stop using turn gem
|
6
|
+
46f603e when the source mirror doesn't work (1.6.8 on java 7), continue
|
7
|
+
9bb9f29 bump version to 0.1.0 from 0.1.0.pre / 0.1.0-SNAPSHOT
|
8
|
+
06dff98 bump bitescript version required to 0.1.2 or higher
|
9
|
+
e74bc53 reenable dynamic, raise nice errors when on jvm < 1.7
|
10
|
+
8bb7728 rename generator's extension compiler to @extension_compiler
|
11
|
+
4936c8c remove dynamic type assignment test
|
12
|
+
c44c78e use the test name as part of the class name of anon Mirah classes in tests
|
13
|
+
56a10ef fix some whitespace in test/jvm/bytecode_test_helper.rb
|
14
|
+
0471e49 clean tmp directory as it's used in building distribution artifacts
|
15
|
+
3824dcc add mirah-util.jar to bootstrap task
|
16
|
+
c78cd1b also rm the mirah-util jar on clean
|
17
|
+
76bc6ef don't blow up if the source mirror can't work. (Java 7-15 appears to have removed an internal class)
|
18
|
+
5ee433f fix java version of class files compiled for 7 instead of 6
|
19
|
+
400b718 Recompile mmeta.BaseParser for Java 6
|
20
|
+
91f4974 Add missing file
|
21
|
+
76facfc Fix DynamicType.superclass. This fixes the tests, but I still think dynamic is generally broken.
|
22
|
+
9057240 Closes #206
|
23
|
+
79c400c Merge https://github.com/mirah/mirah into fix
|
24
|
+
586bfc3 Fix abstract Closes #207
|
25
|
+
d90563f merge
|
26
|
+
9164bf2 Implement static imports with new syntax.
|
27
|
+
09c4a4b Rebuild lexer for Java 6
|
28
|
+
91d3a6a Really update the parser jar this time
|
29
|
+
53fccff Update the parser.
|
30
|
+
1595e89 start a test suite for the examples
|
31
|
+
6d61273 fix string_each_char to work with new ast
|
32
|
+
cec675b clean up import related tests
|
33
|
+
cd17b50 add tests for static macros
|
34
|
+
c9f8bcd fix lower case inner class lookup.
|
35
|
+
69085e8 add lowercase inner class test that fails, add java test fixture for it
|
36
|
+
400d549 don't use Ruby string interpolation on test that uses Mirah interpolation
|
37
|
+
36a5a84 add whitespace to ErrorType
|
38
|
+
d62cfda bump cast_test copyright year to 2013
|
39
|
+
dd9048a fix raise assertion in rescue tests
|
40
|
+
7135761 fix java exception assertion method
|
41
|
+
cacd537 move interface tests into own test case
|
42
|
+
7247dde ensure we don't try cleaning up a class file twice it tests
|
43
|
+
2dc065e move casting tests to their own file
|
44
|
+
23712cb add toString to LocalFuture
|
45
|
+
652179b add to string to CallFuture
|
46
|
+
f968291 primitives shouldn't be convertible to arrays of that primitive
|
47
|
+
5e55644 fix whitespace in factory/ note possibly dead code
|
48
|
+
84262c2 remove array_type if statement that had both sides commented out
|
49
|
+
1fcd805 clean up method_lookup.rb a little, fix printing bitescript mirrors on ambiguity errors
|
50
|
+
f0765f4 move jvm ensure tests to rescue_test
|
51
|
+
884645e add check to make sure gem build fails when generated jars not present
|
52
|
+
6241541 Access RubyGems via SSL so it'll stop whining.
|
53
|
+
9541f01 Bundler uses `vendor` for gems. Ignore it.
|
54
|
+
1a1a68d Fix class_loader_test
|
55
|
+
5414ac3 Fix typer_test.
|
56
|
+
332f4a9 pick primitives last in typer to avoid assuming things are meta as much
|
57
|
+
fe73423 Revert "make typer vcall test pass again." Turns out the test is pointing out a real bug
|
58
|
+
ea265ee make typer vcall test pass again.
|
59
|
+
6fe3c28 add toString to MethodType
|
60
|
+
28e184b Merge pull request #204 from tychobrailleur/maven-fix
|
61
|
+
dd0cba1 Clean up Maven poms.
|
62
|
+
fbbcdb8 Ignore backup files.
|
63
|
+
b11dcfe give super test class better name
|
64
|
+
2fe9b84 don't include minitest, as we don't use it, clean up .class file cleanup
|
65
|
+
0d5691f first pass at doing autoboxing
|
66
|
+
c1a070e rename some block test classes to ensure they don't conflict
|
67
|
+
8479db5 fix dash e, add regression test
|
68
|
+
cb33c59 if a varargs method is passed a matching array, use that as the varargs array
|
69
|
+
9e35eac test cleanup: remove unnecessary clear, add/remove whitespace
|
70
|
+
dcbb4fb missed a varargs method definition
|
71
|
+
c1886fc add varargs support
|
72
|
+
f56c38d add support for referring to macros that have already been compiled.
|
73
|
+
0d866a4 clean up byte code test helper a bit
|
74
|
+
01b6c3b Merge remote-tracking branch 'tychobrailleur/fix_compile'
|
75
|
+
4ad6a4d Ensure resolve return type is ResolvedType.
|
76
|
+
f0fd6b0 Really fix the parser jar this time.
|
77
|
+
f856785 Merge from master
|
78
|
+
3182a90 Recompile some parser classes for java 6.
|
79
|
+
931f041 note that you need jruby 1.7.0 to compile mirah
|
80
|
+
d7bd6a1 Fix bootstrap under jruby 1.7.0
|
81
|
+
9967d48 Fix some tests.
|
82
|
+
af0a9ee Try to get rid of a warning about ambiguos methods
|
83
|
+
aedab51 Fix bootstrap under jruby 1.7.0
|
84
|
+
fadf3c8 Fix widening for stack frames.
|
85
|
+
1b16915 Fix macro loading in 1.7.0
|
86
|
+
5d5ce53 More jruby 1.7.0 fixes (but these break 1.6.x)
|
87
|
+
83a5ce9 Fix interface ambiguity
|
88
|
+
a7283f3 Merge in better parser error handling
|
89
|
+
3a2bbfa Fix for classes which change package.
|
90
|
+
1bd8200 Support declaring a method before the parameter types are resolved.
|
91
|
+
636fe73 Lookup return type for overrides with no declared return type
|
92
|
+
c5a02e1 Fix infinite recursion in AssignableTypeFuture
|
93
|
+
c9e8433 Better error message when method args are missing the type declaration.
|
94
|
+
9438dfc More fixes for better error messages.
|
95
|
+
2631f2c Fix typo
|
96
|
+
c7c8559 Fix error propagation to better show the source of errors.
|
97
|
+
765e50a Fix bug where a local variable foo loads class Foo
|
98
|
+
e4fb346 Remove reference to AST.type_factory
|
99
|
+
978611b don't remove the build dir after finishing the build.
|
100
|
+
02da6ed remove unused constant
|
101
|
+
2c50acb remove references in README to java source generation as it is no longer supported
|
102
|
+
bebcfa4 fix class path for generating ant task
|
103
|
+
1a54f0c add util jar containing ant task, add it to classpath for gem
|
104
|
+
645253b consolidate classpath munging into mirah.rb
|
105
|
+
15483bf some 1.9 fixes: each_with_index => each.with_index / each_line.with_index / zip
|
106
|
+
6a2bd1b Merge pull request #193 from SaberUK/patch-1
|
107
|
+
0a9d165 Merge branch 'master' of https://github.com/mirah/mirah
|
108
|
+
d7f39b8 Compile the ant task.
|
109
|
+
fd25564 rm_f so we can clean even if the file is already missing.
|
110
|
+
90ac5b9 Fix small typo in help message.
|
111
|
+
|
112
|
+
=== 0.1.0.pre RubyConf newast preview release / 2012-11-02
|
113
|
+
|
114
|
+
a104440 change version to 0.1.0.pre
|
115
|
+
afe5384 Add attr_{reader,writer,accessor} builtins.
|
116
|
+
8e31256 Generify array literals and reimplement hash literals the same way as arrays.
|
117
|
+
8976381 Fix hygene for all? and any? builtins.
|
118
|
+
a8c5d60 Fix test_void_chain
|
119
|
+
f9ba709 Fix test_implements
|
120
|
+
9f55cbb Support references to primitive types
|
121
|
+
3aaac97 Support for static macros and casts to array types.
|
122
|
+
179ea1f Fix test_super_constructor
|
123
|
+
cf3e040 Fix test_optional_args
|
124
|
+
6de0a1c Fix test_block_with_method_def
|
125
|
+
dcbb840 Fix a couple macro tests
|
126
|
+
f4102d6 Fixes for trying to compile the typer.
|
127
|
+
fcfc448 Allow widening to the other type, not just its ancestors.
|
128
|
+
939a155 Fixes for mirah-complete.jar
|
129
|
+
e2228bf Bug fixes and better error handling.
|
130
|
+
a6e9cc8 Fix assignable_from?(NullType)
|
131
|
+
fe75374 Remove mirah-builtins.jar in the 'clean' task.
|
132
|
+
4e67815 Merge pull request #192 from nuclearsandwich/whitespace
|
133
|
+
64da41e Strip trailing whitespace from test directory.
|
134
|
+
d61a535 Strip trailing whitespace from examples.
|
135
|
+
a48641b Strip trailing whitespace from lib directory.
|
136
|
+
ce169d2 Strip trailing whitespace from src directory.
|
137
|
+
f9c1910 clean up some debugging code
|
138
|
+
f12db8a Merge branch 'master' of https://github.com/mirah/mirah
|
139
|
+
9e03b1a Fix test_constructor_chaining
|
140
|
+
2b86e38 fix typer rescue test
|
141
|
+
32e1658 add [], []= support to List
|
142
|
+
1dc2d5c rake clean should rm the bootstrap jar
|
143
|
+
7879e20 fix class name of NumericExtensionTest
|
144
|
+
6536e0b add some documentation to the macro builder
|
145
|
+
d72cbe0 Generate missing arguments for blocks
|
146
|
+
f0792db Revert "Remove obsolete test_block_with_no_params_on_interface_with"
|
147
|
+
6fa6472 Fix test_void_chain
|
148
|
+
33dc95a Remove obsolete test_block_with_no_params_on_interface_with
|
149
|
+
0cb1f6a Fix test_parameter_used_in_block
|
150
|
+
1150c0a Implement closures.
|
151
|
+
2875d54 add license/ whitespace to transformer
|
152
|
+
4538141 actually lib/mirah/transform/error.rb isn't used anymore, so deleting it
|
153
|
+
cbf7b6c add license to lib/mirah/transform/error.rb
|
154
|
+
3b66952 add license header to errors file
|
155
|
+
29e8edb clean up underlining
|
156
|
+
8a492b2 unwind some nested logic in jvm method lookup
|
157
|
+
e45e21b put the 0.0.12 history back in
|
158
|
+
26224db Merge branch 'master' into newast
|
159
|
+
93cb158 bump to 0.1.0.dev, because 0.0.x is oldast
|
160
|
+
9e10f98 bump versions to 0.0.13.dev
|
161
|
+
83a021c remove win JAVA_HOME lookup because it has problems with spaces in the PATH
|
162
|
+
b97b567 Add file headers
|
163
|
+
81e94e0 Split up types.mirah
|
164
|
+
9439368 Split up simple.mirah
|
165
|
+
a5384f9 Split up futures.mirah and add some documentation
|
166
|
+
c1ebe5c More quick test fixes
|
167
|
+
c8c28b9 Fix test_interface_declaration
|
168
|
+
b13b84a Fix "Cannot assign #<IntegerType int> to #<VoidType void>" error from void methods
|
169
|
+
ca875de More test fixes
|
170
|
+
1c5542f Fix test_block_with_mirah_interface
|
171
|
+
2e13c9f Fix scope for block args (test_block_with_abstract_from_object)
|
172
|
+
6fe2e59 Fix test_block_impling_interface_w_multiple_methods
|
173
|
+
65dd342 Infer arg types from superclasses or interfaces
|
174
|
+
2329074 Constant narrowing for AttrAssign and ElemAssign nodes
|
175
|
+
1d225d9 Fix test_argument_widening
|
176
|
+
d62ad67 Fix macro inheritance on generic types
|
177
|
+
de79c6f Implement ZSuper
|
178
|
+
e84f525 Delete test_arg_bootclasspath_sets_bootclasspath_on_type_factory_ugh
|
179
|
+
257eb93 Merge
|
180
|
+
c7fdf60 Mostly fix typer tests.
|
181
|
+
ddc1498 Remove the broken java source backend
|
182
|
+
03cbb4b fix #186 on newast, ignore implemented methods in getAbstractMethods on factory
|
183
|
+
65520ec actually use bootclasspath in the generator
|
184
|
+
16647d4 ignore generated/ downloaded jar files
|
185
|
+
4301fc5 actually use the bootclasspath in the bootstrap_loader
|
186
|
+
2ece709 convert IsolatedResouceLoader to Java, put MirahClassLoader's mirah src in a comment, test class loaders.
|
187
|
+
e54d183 add tests for MirahClassLoader
|
188
|
+
8a7f943 add some comments on class loaders
|
189
|
+
39cf42b test that bootclasspath arg sets the bootclasspath
|
190
|
+
b5afc07 add tab to cli help for bootclasspath
|
191
|
+
34af825 Support specifying --bootclasspath
|
192
|
+
e31ed58 fixes #185 ScopedBody's generated by macros outside methods should work
|
193
|
+
b32a286 Merge pull request #184 from pepijndevos/newast
|
194
|
+
cae497b add power macro test
|
195
|
+
9178182 Merge branch 'newast' of https://github.com/mirah/mirah into newast
|
196
|
+
e9da596 Delete dead code
|
197
|
+
81d7b58 basic power macro
|
198
|
+
05615cf Duplicate DelegateClass logic from Ruby 1.8, for consistency.
|
199
|
+
11ec687 update version to 0.0.12.dev
|
200
|
+
2f5ac6c missed the SNAPSHOT in a couple pom.xmls
|
201
|
+
862c760 update history for 0.0.11
|
202
|
+
17814eb set version to 0.0.11
|
203
|
+
e00ab4b comment out bootclasspath test--there is no bootclasspath yet
|
204
|
+
1e46765 add needed breaks in to args processor
|
205
|
+
79c6c66 clean up arg processor interface a bit
|
206
|
+
040d276 rename test classes to match their filenames
|
207
|
+
59a0ccb clean up build_string in java_source
|
208
|
+
b9550e7 fixes #175. wrap string interp prior to calling method on it.
|
209
|
+
54526f5 Merge pull request #174 from nighthacker/master
|
210
|
+
f396297 add test for nested closures, touch struct method where changes were added in master
|
211
|
+
fe53909 previous change was insufficiently argy.
|
212
|
+
0f1cd70 complain if blocks don't have the right number of arguments
|
213
|
+
9b88275 add zip install instructions
|
214
|
+
167c9c2 Update README.txt. Fixes #163
|
215
|
+
f5fdb07 Array.each
|
216
|
+
57faaca add missing files
|
217
|
+
b33ae42 Merge branch 'newast' of github.com:mirah/mirah into newast
|
218
|
+
0291c24 Iterable builtins
|
219
|
+
65c726d Don't run javac backend tests by default -- they're completely broken
|
220
|
+
9541d76 Test fixes
|
221
|
+
bc6b158 Loops
|
222
|
+
6ebe8da Merge branch 'newast' of github.com:mirah/mirah into newast
|
223
|
+
6223111 Re-enable hash_test.rb
|
224
|
+
c43ce7a Hash support
|
225
|
+
1ff787d Clean up trailing newlines.
|
226
|
+
bbc8e4d Handle one level of nesting on return types, and arbitrary nesting on parameters. Also handle wildcards in parameters. Support single 'extends' or 'implements' bounds, but not 'implements' with multiple interfaces.
|
227
|
+
b3cf443 Start implementing hashes
|
228
|
+
8803dd7 Fix test_instance_macro_call
|
229
|
+
41fcca0 Fix test_block_parameter_uses_outer_scope
|
230
|
+
9eca828 Fix test_add_args_in_macro
|
231
|
+
a6f8a07 Some macro fixes
|
232
|
+
d83daa8 Merge branch 'newast' of https://github.com/mirah/mirah into newast
|
233
|
+
63c2101 Basic generics support. Handles only the case where the method parameter or return type are simple type variables.
|
234
|
+
82cf35c puts. Sweet. Except JRuby can't find it most of the time. Cry.
|
235
|
+
8d0df92 Fix package for main type
|
236
|
+
f0499f5 Don't auto-generate a class or a main method unless needed
|
237
|
+
632a453 Add missing file logging.rb
|
238
|
+
5f31337 Add gensym and disable test for hygenic macros
|
239
|
+
34a15a9 Fix macros with arguments
|
240
|
+
ea73382 Write macro annotations
|
241
|
+
ce77a0e Use java logging everywhere
|
242
|
+
7dc94c8 Fix the quote macro
|
243
|
+
fff3962 Fix Call and FunctionalCall macros
|
244
|
+
77cd6f2 fix printing of unqutoes in TypePrinter
|
245
|
+
808b52d Fix vcall macros; one macro test passing.
|
246
|
+
191062e Macro lookup. So close...
|
247
|
+
bced9fa Re-enable macro tests
|
248
|
+
330bfbb Start implementing macro loading
|
249
|
+
b5a61ad Quote macro implementation
|
250
|
+
ec1b520 Add missing file MirahClassLoader.java
|
251
|
+
f0cba97 Macro compilation
|
252
|
+
0ffaa55 Fix compilation of mirah-bootstrap.jar
|
253
|
+
8c594e5 Start implementing macro compilation
|
254
|
+
64dce74 Add missing file
|
255
|
+
4703e7b Fix test_block_with_abstract_from_object
|
256
|
+
c8d613d Move block tests to block_test.rb and split them up
|
257
|
+
6bd8de3 Basic block support
|
258
|
+
18c6d26 Fix mirahp and error processing
|
259
|
+
f3bd920 Start typer support for blocks and macros
|
260
|
+
a272f7b Update parser
|
261
|
+
6d0821f Add Rakefile support for building typer.jar
|
262
|
+
87f1ce5 Merge branch 'newast' of github.com:mirah/mirah into newast
|
263
|
+
4622581 jmeta is mmeta.
|
264
|
+
f0672e1 Fix compiling implicit nil
|
265
|
+
a6b59f6 Disable hash tests
|
266
|
+
a3497cb Fix return type for methods that always raise an exception
|
267
|
+
8238ee7 Fix array return types
|
268
|
+
d1e6f05 Fix loops
|
269
|
+
0f646f7 Fix loops
|
270
|
+
506fb9c test fix
|
271
|
+
fec18f0 Fix long constants
|
272
|
+
a1129c8 fix static method listeners
|
273
|
+
9213d89 Disable enumerable tests for now
|
274
|
+
45a3c43 Fix default constructors
|
275
|
+
a37e0b9 Fix test_inexact_constructor
|
276
|
+
04d02ef Fix constructor chaining
|
277
|
+
6f08cf4 Fix blocks_test
|
278
|
+
eb5e74c Fix annotations
|
279
|
+
1d0062c Cleanup merge issues
|
280
|
+
9b4733f Merge pull request #171 from baroquebobcat/masterful_newast
|
281
|
+
46422d3 merge master into new ast. It's crazy awesome.
|
282
|
+
7c76dd9 Test fixes part 2
|
283
|
+
b6d511f Test fixes
|
284
|
+
4cc953e fix test_not
|
285
|
+
e33454b Fix test_nil_assign
|
286
|
+
af78bd2 Fix test_literal_array
|
287
|
+
cfa426d Fix test_interface_declaration
|
288
|
+
1f942fc Fix test_import, test_import_package
|
289
|
+
16e550c fix test_implements
|
290
|
+
053b89a Fix test_ensure
|
291
|
+
30e6517 Fix test_rescue_scope
|
292
|
+
b33c4dc Fix test_rescue
|
293
|
+
a123bd4 Work on fixing exceptions
|
294
|
+
0f0cbc0 Fix type in rescue support
|
295
|
+
b3bc74e Fix test_class_append_self
|
296
|
+
5a02c90 Fix test_array_with_dynamic_size
|
297
|
+
fc469af Fix test_array_return_type
|
298
|
+
264bd9a Fix test_literal_regexp
|
299
|
+
4e62d93 Fix test_annotations
|
300
|
+
5611920 Fix test_colon2
|
301
|
+
bb12fb0 Fix test_string_concat and test_string_interpolation
|
302
|
+
408fae2 Fix test_super_constructor
|
303
|
+
7a1000e Fix test_super
|
304
|
+
50fb396 Fix test_constructor
|
305
|
+
f1d8eb3 Partial fix for test_return_type
|
306
|
+
5e0c9b3 Update mirah-parser
|
307
|
+
de71d88 Work on fixing test_cast
|
308
|
+
9d19812 Support the AttrAssign node
|
309
|
+
bfda51d Fix 2nd testcase in test_and
|
310
|
+
f786982 Fix first testcase in test_and
|
311
|
+
118697f Fix some bad method calls
|
312
|
+
a93ca0b Use imports when resolving type names
|
313
|
+
a5770f3 disable filename tagging
|
314
|
+
478b921 Work on fixing method lookup
|
315
|
+
d411915 Add the typer .jar
|
316
|
+
bd4cdef Work on getting super to work
|
317
|
+
3bca242 Use System.out.println instead of puts
|
318
|
+
28b2015 Fix more tests
|
319
|
+
4c4dd4b Fix superclass tracking and no-arg block calls
|
320
|
+
cc687c8 Fix arrays
|
321
|
+
7dc7ab4 Get addition working
|
322
|
+
959b435 Start working on test_jvm_compiler
|
323
|
+
5108278 Fix some more compilation errors
|
324
|
+
8b33dab Work around bug in RubyArray.hashCode
|
325
|
+
92db094 Add some more logging during type inference
|
326
|
+
61d3f2f Get hello world compiling
|
327
|
+
df1f9db Start getting jvm compiler to work
|
328
|
+
bbb3423 Mostly fix test_java_typer
|
329
|
+
ada7948 Fix test_typer
|
330
|
+
570efac Work on getting test_typer to pass
|
331
|
+
7203e19 Start using the new typer
|
332
|
+
88a047d Get the typer to compile
|
333
|
+
e246b53 Unquote fixes
|
334
|
+
6f170d8 Fix typo
|
335
|
+
486f70f Implement UnquoteAssign
|
336
|
+
e822c5f Fix some compilation errors
|
337
|
+
0fafe68 Start new inference engine
|
338
|
+
dafc7ca Fix custom scopes on locals
|
339
|
+
b24f54e Fix test_add_args_in_macro
|
340
|
+
bcdef19 Fix test_self_call_preserves_scope
|
341
|
+
428c493 Fix hash literals
|
342
|
+
1f2f4a4 Fix generator
|
343
|
+
2f46511 Fix merge error
|
344
|
+
5eb7bde Merge
|
345
|
+
79a5cc6 Rebuild bootrap jar
|
346
|
+
b08d2bb Fix scope for self_call macros
|
347
|
+
3dfb2f4 Fix some more tests
|
348
|
+
5edb785 Fix some tests
|
349
|
+
ef1f7f6 Serialize AST as text instead of using Marshal. This seems a bit fragile, but it should be enough to bootstrap the new AST.
|
350
|
+
c28a393 Get rid of ScopedBody nodes
|
351
|
+
|
352
|
+
=== 0.0.12 Working Jars / 2012-07-22
|
353
|
+
|
354
|
+
c06e1df bump versions to 0.0.12
|
355
|
+
827434c remove win JAVA_HOME lookup because it has problems with spaces in the PATH
|
356
|
+
cb10541 update maven instructions to use deploy instead of release.
|
357
|
+
1e57c10 If we're in a jar, look in the jar for our classes.
|
358
|
+
3b49e48 drop maven versions back to 0.0.12-SNAPSHOT
|
359
|
+
c0b15d5 [maven-release-plugin] prepare for next development iteration
|
360
|
+
fed593b [maven-release-plugin] prepare release shared-0.0.12
|
361
|
+
5b1c8b1 fix #186 improving abstract class based closure support
|
362
|
+
40a0c94 remove some more debugging puts
|
363
|
+
6ec7338 fixes #185 ScopedBody's generated by macros outside methods should work
|
364
|
+
a86c365 use logging instead of puts on giving up in typer
|
365
|
+
b267200 Merge parser-support w/o puts'
|
366
|
+
42830b9 Duplicate DelegateClass logic from Ruby 1.8, for consistency.
|
367
|
+
fa3b2a3 Duplicate Ruby 1.8 DelegateClass logic to get back to tests passing.
|
368
|
+
9ca8517 Remove logging I left in.
|
369
|
+
02b5c48 Fixes to get Mirah working with JRuby master in 1.8 and 1.9 modes.
|
370
|
+
9e0c2d1 update version to 0.0.12.dev
|
371
|
+
8a9a644 missed the SNAPSHOT in a couple pom.xmls
|
372
|
+
|
1
373
|
=== 0.0.11 Pre-Hackathon Edition / 2012-04-09
|
2
374
|
|
3
375
|
235e887 set version to 0.0.11
|
data/README.txt
CHANGED
@@ -8,12 +8,12 @@
|
|
8
8
|
Mirah is a customizable programming language featuring static types,
|
9
9
|
local type inference and a heavily Ruby-inspired syntax. Mirah
|
10
10
|
currently includes a typer/compiler backend for the JVM which can
|
11
|
-
output
|
11
|
+
output JVM bytecode.
|
12
12
|
|
13
13
|
== FEATURES:
|
14
14
|
|
15
15
|
* Ruby-like syntax
|
16
|
-
* Compiles to .class
|
16
|
+
* Compiles to .class
|
17
17
|
* Fast as Java
|
18
18
|
* No runtime library
|
19
19
|
|
@@ -23,8 +23,6 @@ mirah <script.mirah>
|
|
23
23
|
mirah -e "inline script"
|
24
24
|
mirahc <script.mirah>
|
25
25
|
mirahc -e "inline script" # produces DashE.class
|
26
|
-
mirahc --java <script.mirah>
|
27
|
-
mirahc --java -e "inline script" # produces DashE.java
|
28
26
|
|
29
27
|
== REQUIREMENTS:
|
30
28
|
|
@@ -46,7 +44,8 @@ Extract it, and add `bin` to your `$PATH` to be able to use `mirah`, `mirahc`, e
|
|
46
44
|
|
47
45
|
=== SOURCE:
|
48
46
|
|
49
|
-
To build and install from source,
|
47
|
+
To build and install from source, you'll need jruby 1.7.0 or
|
48
|
+
higher. Then just follow these commands.
|
50
49
|
|
51
50
|
$ git clone http://github.com/mirah/mirah.git
|
52
51
|
$ cd mirah
|
data/Rakefile
CHANGED
@@ -30,8 +30,8 @@ end
|
|
30
30
|
bitescript_lib_dir = File.dirname Gem.find_files('bitescript').first
|
31
31
|
|
32
32
|
task :gem => 'jar:bootstrap'
|
33
|
-
|
34
|
-
task :default => :test
|
33
|
+
task :bootstrap => ['javalib/mirah-bootstrap.jar', 'javalib/mirah-builtins.jar', 'javalib/mirah-util.jar']
|
34
|
+
task :default => :'test:jvm:bytecode'
|
35
35
|
def run_tests tests
|
36
36
|
results = tests.map do |name|
|
37
37
|
begin
|
@@ -52,17 +52,18 @@ desc "run full test suite"
|
|
52
52
|
task :test do
|
53
53
|
run_tests [ 'test:core', 'test:plugins', 'test:jvm' ]
|
54
54
|
end
|
55
|
+
|
55
56
|
namespace :test do
|
56
57
|
|
57
58
|
desc "run the core tests"
|
58
|
-
Rake::TestTask.new :core do |t|
|
59
|
+
Rake::TestTask.new :core => :bootstrap do |t|
|
59
60
|
t.libs << 'test'
|
60
61
|
t.test_files = FileList["test/core/**/*test.rb"]
|
61
62
|
java.lang.System.set_property("jruby.duby.enabled", "true")
|
62
63
|
end
|
63
64
|
|
64
65
|
desc "run tests for plugins"
|
65
|
-
Rake::TestTask.new :plugins do |t|
|
66
|
+
Rake::TestTask.new :plugins => :bootstrap do |t|
|
66
67
|
t.libs << 'test'
|
67
68
|
t.test_files = FileList["test/plugins/**/*test.rb"]
|
68
69
|
java.lang.System.set_property("jruby.duby.enabled", "true")
|
@@ -70,27 +71,27 @@ namespace :test do
|
|
70
71
|
|
71
72
|
desc "run jvm tests, both bytecode and java source"
|
72
73
|
task :jvm do
|
73
|
-
run_tests ["test:jvm:bytecode"
|
74
|
+
run_tests ["test:jvm:bytecode"]
|
74
75
|
end
|
75
76
|
|
76
77
|
namespace :jvm do
|
77
78
|
desc "run jvm tests compiling to bytecode"
|
78
|
-
Rake::TestTask.new :bytecode do |t|
|
79
|
+
Rake::TestTask.new :bytecode => [:bootstrap, :clean_tmp_test_directory, :build_test_fixtures] do |t|
|
79
80
|
t.libs << 'test' <<'test/jvm'
|
80
81
|
t.ruby_opts.concat ["-r", "bytecode_test_helper"]
|
81
82
|
t.test_files = FileList["test/jvm/**/*test.rb"]
|
82
|
-
java.lang.System.set_property("jruby.duby.enabled", "true")
|
83
83
|
end
|
84
|
+
end
|
85
|
+
end
|
84
86
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
t.test_files = FileList["test/jvm/**/*test.rb"]
|
90
|
-
java.lang.System.set_property("jruby.duby.enabled", "true")
|
91
|
-
end
|
87
|
+
task :clean_tmp_test_directory do
|
88
|
+
FileUtils.rm_rf "tmp_test"
|
89
|
+
FileUtils.mkdir_p "tmp_test"
|
90
|
+
end
|
92
91
|
|
93
|
-
|
92
|
+
task :build_test_fixtures do
|
93
|
+
ant.javac :destdir => "tmp_test", :srcdir => 'test/fixtures',
|
94
|
+
:includeantruntime => false, :debug => true, :listfiles => true
|
94
95
|
end
|
95
96
|
|
96
97
|
task :init do
|
@@ -102,43 +103,14 @@ desc "clean up build artifacts"
|
|
102
103
|
task :clean do
|
103
104
|
ant.delete :quiet => true, :dir => 'build'
|
104
105
|
ant.delete :quiet => true, :dir => 'dist'
|
106
|
+
rm_f 'javalib/mirah-bootstrap.jar'
|
107
|
+
rm_f 'javalib/mirah-builtins.jar'
|
108
|
+
rm_f 'javalib/mirah-util.jar'
|
109
|
+
rm_rf 'tmp'
|
105
110
|
end
|
106
111
|
|
107
|
-
task :compile => :init
|
108
|
-
|
109
|
-
# build the Ruby sources
|
110
|
-
puts "Compiling Ruby sources"
|
111
|
-
JRuby::Compiler.compile_argv([
|
112
|
-
'-t', 'build',
|
113
|
-
'--javac',
|
114
|
-
'src/org/mirah/mirah_command.rb'
|
115
|
-
])
|
116
|
-
|
117
|
-
# build the Mirah sources
|
118
|
-
puts "Compiling Mirah sources"
|
119
|
-
Dir.chdir 'src' do
|
120
|
-
classpath = Mirah::Env.encode_paths([
|
121
|
-
'javalib/jruby-complete.jar',
|
122
|
-
'javalib/JRubyParser.jar',
|
123
|
-
'build',
|
124
|
-
'/usr/share/ant/lib/ant.jar'
|
125
|
-
])
|
126
|
-
Mirah.compile(
|
127
|
-
'-c', classpath,
|
128
|
-
'-d', '../build',
|
129
|
-
'--jvm', '1.6',
|
130
|
-
'org/mirah',
|
131
|
-
'duby/lang',
|
132
|
-
'mirah'
|
133
|
-
)
|
134
|
-
end
|
135
|
-
|
136
|
-
# compile invokedynamic stuff
|
137
|
-
ant.javac :destdir => 'build', :srcdir => 'src',
|
138
|
-
:includes => 'org/mirah/DynalangBootstrap.java',
|
139
|
-
:classpath => 'javalib/dynalink-0.1.jar:javalib/jsr292-mock.jar',
|
140
|
-
:includeantruntime => false
|
141
|
-
end
|
112
|
+
task :compile => [:init, :bootstrap, :util]
|
113
|
+
task :util => 'javalib/mirah-util.jar'
|
142
114
|
|
143
115
|
desc "build basic jar for distribution"
|
144
116
|
task :jar => :compile do
|
@@ -147,6 +119,9 @@ task :jar => :compile do
|
|
147
119
|
fileset :dir => 'build'
|
148
120
|
fileset :dir => '.', :includes => 'bin/*'
|
149
121
|
fileset :dir => bitescript_lib_dir
|
122
|
+
zipfileset :src => 'javalib/mirah-bootstrap.jar'
|
123
|
+
zipfileset :src => 'javalib/mirah-builtins.jar'
|
124
|
+
zipfileset :src => 'javalib/mirah-util.jar'
|
150
125
|
manifest do
|
151
126
|
attribute :name => 'Main-Class', :value => 'org.mirah.MirahCommand'
|
152
127
|
end
|
@@ -168,11 +143,7 @@ namespace :jar do
|
|
168
143
|
end
|
169
144
|
|
170
145
|
desc "build bootstrap jar used by the gem"
|
171
|
-
task :bootstrap =>
|
172
|
-
ant.jar :jarfile => 'javalib/mirah-bootstrap.jar' do
|
173
|
-
fileset :dir => 'build'
|
174
|
-
end
|
175
|
-
end
|
146
|
+
task :bootstrap => 'javalib/mirah-bootstrap.jar'
|
176
147
|
end
|
177
148
|
|
178
149
|
desc "Build a distribution zip file"
|
@@ -196,3 +167,155 @@ end
|
|
196
167
|
|
197
168
|
desc "Build all redistributable files"
|
198
169
|
task :dist => [:gem, :zip]
|
170
|
+
|
171
|
+
file_create 'javalib/mirah-newast-transitional.jar' do
|
172
|
+
require 'open-uri'
|
173
|
+
puts "Downloading mirah-newast-transitional.jar"
|
174
|
+
open('http://mirah.googlecode.com/files/mirah-newast-transitional.jar', 'rb') do |src|
|
175
|
+
open('javalib/mirah-newast-transitional.jar', 'wb') do |dest|
|
176
|
+
dest.write(src.read)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
file 'javalib/mirah-bootstrap.jar' => ['javalib/mirah-newast-transitional.jar',
|
182
|
+
'src/org/mirah/MirahClassLoader.java',
|
183
|
+
'src/org/mirah/IsolatedResourceLoader.java',
|
184
|
+
'src/org/mirah/MirahLogFormatter.mirah',
|
185
|
+
'src/org/mirah/util/simple_diagnostics.mirah'] +
|
186
|
+
Dir['src/org/mirah/{macros,typer}/*.mirah'] +
|
187
|
+
Dir['src/org/mirah/typer/simple/*.mirah'] +
|
188
|
+
Dir['src/org/mirah/macros/anno/*.java'] do
|
189
|
+
build_dir = 'build/bootstrap'
|
190
|
+
rm_rf build_dir
|
191
|
+
mkdir_p build_dir
|
192
|
+
|
193
|
+
# Compile annotations and class loader
|
194
|
+
ant.javac :destdir => build_dir, :srcdir => 'src',
|
195
|
+
:includeantruntime => false, :debug => true, :listfiles => true
|
196
|
+
|
197
|
+
# Compile the Typer and Macro compiler
|
198
|
+
bootstrap_mirahc('src/org/mirah/macros', 'src/org/mirah/MirahLogFormatter.mirah', 'src/org/mirah/typer',
|
199
|
+
'src/org/mirah/util/simple_diagnostics.mirah',
|
200
|
+
:classpath => ['javalib/mirah-parser.jar', 'build/bootstrap'],
|
201
|
+
:dest => build_dir
|
202
|
+
# :options => ['-V']
|
203
|
+
)
|
204
|
+
add_quote_macro
|
205
|
+
cp Dir['src/org/mirah/macros/*.tpl'], "#{build_dir}/org/mirah/macros"
|
206
|
+
|
207
|
+
# Build the jar
|
208
|
+
ant.jar :jarfile => 'javalib/mirah-bootstrap.jar' do
|
209
|
+
fileset :dir => build_dir
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
|
214
|
+
file 'javalib/mirah-util.jar' do
|
215
|
+
require 'mirah'
|
216
|
+
build_dir = 'build/util'
|
217
|
+
rm_rf build_dir
|
218
|
+
mkdir_p build_dir
|
219
|
+
|
220
|
+
# build the Ruby sources
|
221
|
+
puts "Compiling Ruby sources"
|
222
|
+
JRuby::Compiler.compile_argv([
|
223
|
+
'-t', build_dir,
|
224
|
+
'--javac',
|
225
|
+
'src/org/mirah/mirah_command.rb'
|
226
|
+
])
|
227
|
+
|
228
|
+
# compile ant stuff
|
229
|
+
ant_classpath = $CLASSPATH.grep(/ant/).map{|x| x.sub(/^file:/,'')}.join(File::PATH_SEPARATOR)
|
230
|
+
sh *%W(jruby -Ilib bin/mirahc --classpath #{ant_classpath}:#{build_dir} --dest #{build_dir} src/org/mirah/ant)
|
231
|
+
|
232
|
+
# compile invokedynamic stuff
|
233
|
+
ant.javac :destdir => build_dir, :srcdir => 'src',
|
234
|
+
:includes => 'org/mirah/DynalangBootstrap.java',
|
235
|
+
:classpath => 'javalib/dynalink-0.1.jar:javalib/jsr292-mock.jar',
|
236
|
+
:includeantruntime => false
|
237
|
+
|
238
|
+
# Build the jar
|
239
|
+
ant.jar :jarfile => 'javalib/mirah-util.jar' do
|
240
|
+
fileset :dir => build_dir
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
|
245
|
+
file 'javalib/mirah-builtins.jar' => ['javalib/mirah-bootstrap.jar'] + Dir['src/org/mirah/builtins/*.mirah'] do
|
246
|
+
rm_f 'javalib/mirah-builtins.jar'
|
247
|
+
rm_rf 'build/builtins'
|
248
|
+
mkdir_p 'build/builtins'
|
249
|
+
sh *%w(jruby -Ilib bin/mirahc --dest build/builtins src/org/mirah/builtins)
|
250
|
+
ant.jar :jarfile => 'javalib/mirah-builtins.jar' do
|
251
|
+
fileset :dir => 'build/builtins'
|
252
|
+
end
|
253
|
+
rm_rf 'build/builtins'
|
254
|
+
end
|
255
|
+
|
256
|
+
|
257
|
+
if Float(JRUBY_VERSION[0..2]) >= 1.7
|
258
|
+
require 'bitescript'
|
259
|
+
class Annotater < BiteScript::ASM::ClassVisitor
|
260
|
+
def initialize(filename, &block)
|
261
|
+
cr = BiteScript::ASM::ClassReader.new(java.io.FileInputStream.new(filename))
|
262
|
+
cw = BiteScript::ASM::ClassWriter.new(0)
|
263
|
+
super(BiteScript::ASM::Opcodes::ASM4, cw)
|
264
|
+
@block = block
|
265
|
+
cr.accept(self, 0)
|
266
|
+
f = java.io.FileOutputStream.new(filename)
|
267
|
+
f.write(cw.toByteArray)
|
268
|
+
f.close
|
269
|
+
end
|
270
|
+
def visitSource(*args); end
|
271
|
+
def visit(version, access, name, sig, superclass, interfaces)
|
272
|
+
super
|
273
|
+
@block.call(self)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
def add_quote_macro
|
279
|
+
raise "Can't compile on JRuby less than 1.7" unless defined?(Annotater)
|
280
|
+
Annotater.new('build/bootstrap/org/mirah/macros/QuoteMacro.class') do |klass|
|
281
|
+
av = klass.visitAnnotation('Lorg/mirah/macros/anno/MacroDef;', true)
|
282
|
+
av.visit("name", "quote")
|
283
|
+
args = av.visitAnnotation('arguments', 'Lorg/mirah/macros/anno/MacroArgs;')
|
284
|
+
req = args.visitArray('required')
|
285
|
+
req.visit(nil, 'mirah.lang.ast.Block')
|
286
|
+
req.visitEnd
|
287
|
+
args.visitEnd
|
288
|
+
av.visitEnd
|
289
|
+
end
|
290
|
+
Annotater.new('build/bootstrap/org/mirah/macros/Macro.class') do |klass|
|
291
|
+
av = klass.visitAnnotation('Lorg/mirah/macros/anno/Extensions;', false)
|
292
|
+
macros = av.visitArray('macros')
|
293
|
+
macros.visit(nil, 'org.mirah.macros.QuoteMacro')
|
294
|
+
macros.visitEnd
|
295
|
+
av.visitEnd
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
def bootstrap_mirahc(*paths)
|
300
|
+
options = if paths[-1].kind_of?(Hash)
|
301
|
+
paths.pop
|
302
|
+
else
|
303
|
+
{}
|
304
|
+
end
|
305
|
+
args = options[:options] || []
|
306
|
+
if options[:classpath]
|
307
|
+
args << '--classpath' << options[:classpath].map {|p| File.expand_path(p)}.join(File::PATH_SEPARATOR)
|
308
|
+
end
|
309
|
+
args << '-d' << File.expand_path(options[:dest])
|
310
|
+
jarfile = File.expand_path('javalib/mirah-newast-transitional.jar')
|
311
|
+
Dir.chdir(options[:dir] || '.') do
|
312
|
+
runjava(jarfile, 'compile', *(args + paths))
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
def runjava(jar, *args)
|
317
|
+
sh 'java', '-jar', jar, *args
|
318
|
+
unless $?.success?
|
319
|
+
exit $?.exitstatus
|
320
|
+
end
|
321
|
+
end
|