mirah 0.0.4-java → 0.0.5-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +23 -0
- data/README.txt +13 -5
- data/Rakefile +30 -2
- data/bin/duby +16 -0
- data/bin/dubyc +16 -0
- data/bin/dubyp +16 -0
- data/bin/jrubyp +16 -0
- data/bin/mirah +17 -1
- data/bin/mirah.cmd +15 -0
- data/bin/mirahc +17 -1
- data/bin/mirahc.cmd +16 -1
- data/bin/mirahp +17 -1
- data/bin/mirahp.cmd +16 -1
- data/examples/appengine/Rakefile +17 -2
- data/examples/appengine/src/org/mirah/MirahApp.mirah +15 -0
- data/examples/bintrees.mirah +15 -0
- data/examples/construction.mirah +15 -0
- data/examples/dynamic.mirah +15 -0
- data/examples/edb.mirah +15 -0
- data/examples/fib.mirah +15 -0
- data/examples/fields.mirah +15 -0
- data/examples/fractal.mirah +15 -0
- data/examples/java_thing.mirah +15 -0
- data/examples/plugins/appengine/Rakefile +19 -4
- data/examples/plugins/appengine/lib/com/google/appengine/ext/duby/db/datastore.rb +21 -6
- data/examples/plugins/appengine/src/com/google/appengine/ext/duby/db/Model.duby +15 -0
- data/examples/plugins/appengine/test/com/google/appengine/ext/duby/db/ModelTest.duby +15 -0
- data/examples/simple_class.mirah +16 -1
- data/examples/sort_closure.mirah +15 -0
- data/examples/swing.mirah +17 -2
- data/examples/tak.mirah +15 -0
- data/examples/wiki/Rakefile +17 -2
- data/examples/wiki/src/org/mirah/wiki/MirahWiki.duby +15 -0
- data/examples/wiki/war/src/org/mirah/wiki/MirahWiki.duby +339 -0
- data/examples/wiki/war/src/org/mirah/wiki/edit.eduby.html +42 -0
- data/examples/wiki/war/src/org/mirah/wiki/error.eduby.html +2 -0
- data/examples/wiki/war/src/org/mirah/wiki/layout.eduby.html +69 -0
- data/examples/wiki/war/src/org/mirah/wiki/parser.eduby.html +7 -0
- data/examples/wiki/war/src/org/mirah/wiki/view.eduby.html +15 -0
- data/javalib/mirah-bootstrap.jar +0 -0
- data/javalib/mirah-parser.jar +0 -0
- data/lib/duby.rb +15 -0
- data/lib/mirah/appengine_tasks.rb +20 -6
- data/lib/mirah/ast/call.rb +19 -4
- data/lib/mirah/ast/class.rb +19 -4
- data/lib/mirah/ast/flow.rb +16 -1
- data/lib/mirah/ast/intrinsics.rb +36 -21
- data/lib/mirah/ast/literal.rb +16 -1
- data/lib/mirah/ast/local.rb +16 -1
- data/lib/mirah/ast/method.rb +18 -3
- data/lib/mirah/ast/scope.rb +19 -4
- data/lib/mirah/ast/structure.rb +16 -1
- data/lib/mirah/ast/type.rb +24 -9
- data/lib/mirah/ast.rb +24 -9
- data/lib/mirah/compiler.rb +16 -1
- data/lib/mirah/env.rb +16 -1
- data/lib/mirah/jvm/base.rb +18 -3
- data/lib/mirah/jvm/compiler.rb +35 -21
- data/lib/mirah/jvm/method_lookup.rb +16 -1
- data/lib/mirah/jvm/source_compiler.rb +29 -14
- data/lib/mirah/jvm/source_generator/builder.rb +21 -6
- data/lib/mirah/jvm/source_generator/loops.rb +16 -1
- data/lib/mirah/jvm/source_generator/precompile.rb +17 -2
- data/lib/mirah/jvm/source_generator/typer.rb +17 -2
- data/lib/mirah/jvm/typer.rb +19 -4
- data/lib/mirah/jvm/types/basic_types.rb +16 -1
- data/lib/mirah/jvm/types/boolean.rb +17 -2
- data/lib/mirah/jvm/types/enumerable.rb +21 -6
- data/lib/mirah/jvm/types/extensions.rb +16 -1
- data/lib/mirah/jvm/types/factory.rb +18 -3
- data/lib/mirah/jvm/types/floats.rb +16 -1
- data/lib/mirah/jvm/types/integers.rb +22 -7
- data/lib/mirah/jvm/types/intrinsics.rb +29 -14
- data/lib/mirah/jvm/types/literals.rb +16 -1
- data/lib/mirah/jvm/types/methods.rb +24 -9
- data/lib/mirah/jvm/types/number.rb +16 -1
- data/lib/mirah/jvm/types.rb +23 -4
- data/lib/mirah/nbcompiler.rb +19 -4
- data/lib/mirah/plugin/edb.rb +18 -3
- data/lib/mirah/plugin/gwt.rb +22 -7
- data/lib/mirah/plugin/java.rb +18 -3
- data/lib/mirah/transform.rb +35 -20
- data/lib/mirah/transform2.rb +20 -5
- data/lib/mirah/typer.rb +23 -8
- data/lib/mirah/version.rb +18 -0
- data/lib/mirah.rb +101 -50
- data/lib/mirah_task.rb +27 -12
- data/test/test_ast.rb +16 -1
- data/test/test_compilation.rb +18 -3
- data/test/test_env.rb +26 -11
- data/test/test_gwt.rb +18 -3
- data/test/test_java_typer.rb +27 -12
- data/test/test_javac_compiler.rb +17 -2
- data/test/test_jvm_compiler.rb +44 -14
- data/test/test_typer.rb +16 -1
- metadata +203 -193
data/History.txt
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
=== 0.0.5 / 2010-12-22
|
2
|
+
|
3
|
+
8e00222 Update mirah-parser.jar to one built from mirah-parser project.
|
4
|
+
466a21c Update mirah-bootstrap.jar for re-namespaced Mirah classes and modules.
|
5
|
+
b62603f Fix a bug in __ruby_eval caused by a fix for JRUBY-5163.
|
6
|
+
d17af25 NullType is assignable from any non-primitive type.
|
7
|
+
805586f add rake gem task
|
8
|
+
3be367b update readme install instructions
|
9
|
+
6ac3fb1 add descriptions to rake tasks
|
10
|
+
0ca5b96 use the JRuby classloader as parent for the Mirah class loader. Otherwise it doesn't load th
|
11
|
+
e6c95c3 add license to the pom and parent to release artifacts into the sonatype repository
|
12
|
+
c767233 mirah-complete already includes jruby-complete, so it's not a dependency
|
13
|
+
f7d36af variable versions mess the pom descriptor
|
14
|
+
137e859 fix distribution directory and allow maven to complete the package lifecycle
|
15
|
+
52ff7d1 add maven descriptor files to publish mirah into a maven repository
|
16
|
+
|
17
|
+
=== 0.0.4 / 2010-11-17
|
18
|
+
|
19
|
+
* Lots of cleanup, bugs fixed
|
20
|
+
* New parser written in Mirah
|
21
|
+
* Improved annotation support
|
22
|
+
* New macro syntax
|
23
|
+
|
1
24
|
=== 0.0.3 / 2010-06-09
|
2
25
|
|
3
26
|
* Even more language features!
|
data/README.txt
CHANGED
@@ -32,15 +32,23 @@ mirahc -java -e "inline script" # produces DashE.java
|
|
32
32
|
|
33
33
|
== INSTALL:
|
34
34
|
|
35
|
-
If your
|
35
|
+
If your gem and rake are not from from JRuby, prefix the commands with jruby -S
|
36
36
|
|
37
|
-
|
37
|
+
$ gem install mirah
|
38
38
|
|
39
|
-
|
39
|
+
To build and install from source,
|
40
40
|
|
41
|
-
|
41
|
+
$ git clone http://github.com/headius/bitescript.git
|
42
|
+
$ git clone http://github.com/mirah/mirah.git
|
43
|
+
$ cd bitescript
|
44
|
+
$ gem build bitescript.gemspec
|
45
|
+
$ gem install bitescript-*
|
46
|
+
$ cd -
|
47
|
+
$ cd mirah
|
48
|
+
$ rake gem
|
49
|
+
$ gem install pkg/mirah-*
|
50
|
+
$ cd -
|
42
51
|
|
43
|
-
Only JRuby is supported at this time.
|
44
52
|
|
45
53
|
== For Java tools:
|
46
54
|
|
data/Rakefile
CHANGED
@@ -1,11 +1,35 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
require 'rake'
|
2
17
|
require 'rake/testtask'
|
18
|
+
require 'rubygems'
|
19
|
+
require 'rubygems/package_task'
|
3
20
|
require 'java'
|
4
21
|
$: << './lib'
|
5
22
|
require 'mirah'
|
6
23
|
require 'jruby/compiler'
|
7
24
|
require 'ant'
|
8
25
|
|
26
|
+
Gem::PackageTask.new Gem::Specification.load('mirah.gemspec') do |pkg|
|
27
|
+
pkg.need_zip = true
|
28
|
+
pkg.need_tar = true
|
29
|
+
end
|
30
|
+
|
31
|
+
task :gem => 'jar:bootstrap'
|
32
|
+
|
9
33
|
task :default => :test
|
10
34
|
|
11
35
|
Rake::TestTask.new :test do |t|
|
@@ -21,6 +45,7 @@ task :init do
|
|
21
45
|
mkdir_p 'build'
|
22
46
|
end
|
23
47
|
|
48
|
+
desc "clean up build artifacts"
|
24
49
|
task :clean do
|
25
50
|
ant.delete :quiet => true, :dir => 'build'
|
26
51
|
ant.delete :quiet => true, :dir => 'dist'
|
@@ -38,13 +63,13 @@ task :compile => :init do
|
|
38
63
|
# build the Mirah sources
|
39
64
|
puts "Compiling Mirah sources"
|
40
65
|
Dir.chdir 'src' do
|
41
|
-
classpath =
|
66
|
+
classpath = Mirah::Env.encode_paths([
|
42
67
|
'javalib/jruby-complete.jar',
|
43
68
|
'javalib/JRubyParser.jar',
|
44
69
|
'build',
|
45
70
|
'/usr/share/ant/lib/ant.jar'
|
46
71
|
])
|
47
|
-
|
72
|
+
Mirah.compile(
|
48
73
|
'-c', classpath,
|
49
74
|
'-d', '../build',
|
50
75
|
'org/mirah',
|
@@ -54,6 +79,7 @@ task :compile => :init do
|
|
54
79
|
end
|
55
80
|
end
|
56
81
|
|
82
|
+
desc "build basic jar for distribution"
|
57
83
|
task :jar => :compile do
|
58
84
|
ant.jar :jarfile => 'dist/mirah.jar' do
|
59
85
|
fileset :dir => 'lib'
|
@@ -67,6 +93,7 @@ task :jar => :compile do
|
|
67
93
|
end
|
68
94
|
|
69
95
|
namespace :jar do
|
96
|
+
desc "build self-contained, complete jar"
|
70
97
|
task :complete => :jar do
|
71
98
|
ant.jar :jarfile => 'dist/mirah-complete.jar' do
|
72
99
|
zipfileset :src => 'dist/mirah.jar'
|
@@ -78,6 +105,7 @@ namespace :jar do
|
|
78
105
|
end
|
79
106
|
end
|
80
107
|
|
108
|
+
desc "build bootstrap jar used by the gem"
|
81
109
|
task :bootstrap => :compile do
|
82
110
|
ant.jar :jarfile => 'javalib/mirah-bootstrap.jar' do
|
83
111
|
fileset :dir => 'build'
|
data/bin/duby
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
data/bin/dubyc
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
data/bin/dubyp
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
data/bin/jrubyp
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
$: << File.dirname(File.dirname(__FILE__)) + '/lib'
|
3
19
|
require 'mirah'
|
4
20
|
|
data/bin/mirah
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
@@ -6,4 +22,4 @@ rescue LoadError
|
|
6
22
|
require 'mirah'
|
7
23
|
end
|
8
24
|
|
9
|
-
|
25
|
+
Mirah.run(*ARGV)
|
data/bin/mirah.cmd
CHANGED
@@ -1 +1,16 @@
|
|
1
|
+
REM Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
REM All contributing project authors may be found in the NOTICE file.
|
3
|
+
REM
|
4
|
+
REM Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
REM you may not use this file except in compliance with the License.
|
6
|
+
REM You may obtain a copy of the License at
|
7
|
+
REM
|
8
|
+
REM http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
REM
|
10
|
+
REM Unless required by applicable law or agreed to in writing, software
|
11
|
+
REM distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
REM See the License for the specific language governing permissions and
|
14
|
+
REM limitations under the License.
|
15
|
+
|
1
16
|
@jruby "%~dpn0" %*
|
data/bin/mirahc
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
@@ -6,4 +22,4 @@ rescue LoadError
|
|
6
22
|
require 'mirah'
|
7
23
|
end
|
8
24
|
|
9
|
-
|
25
|
+
Mirah.compile(*ARGV)
|
data/bin/mirahc.cmd
CHANGED
@@ -1 +1,16 @@
|
|
1
|
-
|
1
|
+
REM Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
REM All contributing project authors may be found in the NOTICE file.
|
3
|
+
REM
|
4
|
+
REM Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
REM you may not use this file except in compliance with the License.
|
6
|
+
REM You may obtain a copy of the License at
|
7
|
+
REM
|
8
|
+
REM http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
REM
|
10
|
+
REM Unless required by applicable law or agreed to in writing, software
|
11
|
+
REM distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
REM See the License for the specific language governing permissions and
|
14
|
+
REM limitations under the License.
|
15
|
+
|
16
|
+
@jruby "%~dpn0" %*
|
data/bin/mirahp
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
4
|
+
# All contributing project authors may be found in the NOTICE file.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
2
18
|
begin
|
3
19
|
require 'mirah'
|
4
20
|
rescue LoadError
|
@@ -6,4 +22,4 @@ rescue LoadError
|
|
6
22
|
require 'mirah'
|
7
23
|
end
|
8
24
|
|
9
|
-
puts
|
25
|
+
puts Mirah.parse(*ARGV).inspect
|
data/bin/mirahp.cmd
CHANGED
@@ -1 +1,16 @@
|
|
1
|
-
|
1
|
+
REM Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
REM All contributing project authors may be found in the NOTICE file.
|
3
|
+
REM
|
4
|
+
REM Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
REM you may not use this file except in compliance with the License.
|
6
|
+
REM You may obtain a copy of the License at
|
7
|
+
REM
|
8
|
+
REM http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
REM
|
10
|
+
REM Unless required by applicable law or agreed to in writing, software
|
11
|
+
REM distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
REM See the License for the specific language governing permissions and
|
14
|
+
REM limitations under the License.
|
15
|
+
|
16
|
+
@jruby "%~dpn0" %*
|
data/examples/appengine/Rakefile
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
# Hack to use the latest version instead of the gems when developing Mirah
|
2
17
|
if File.exist?('../../lib/mirah.rb')
|
3
18
|
$: << File.expand_path('../../lib')
|
@@ -9,8 +24,8 @@ require 'mirah/appengine_tasks'
|
|
9
24
|
|
10
25
|
appengine_app :app
|
11
26
|
|
12
|
-
MIRAH_APP = "#{
|
13
|
-
LIST = "#{
|
27
|
+
MIRAH_APP = "#{Mirah.dest_path}/org/mirah/MirahApp.class"
|
28
|
+
LIST = "#{Mirah.source_path}/org/mirah/list.dhtml"
|
14
29
|
|
15
30
|
# We want to recompile the app if the template gets modified
|
16
31
|
Rake::Task[MIRAH_APP].enhance([LIST])
|
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
import java.util.HashMap
|
2
17
|
import java.util.regex.Pattern
|
3
18
|
|
data/examples/bintrees.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
class BinaryTrees
|
2
17
|
def self.main(args:String[])
|
3
18
|
n = 0
|
data/examples/construction.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
import "java.lang.StringBuffer"
|
2
17
|
import "java.util.ArrayList"
|
3
18
|
|
data/examples/dynamic.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
# Example of using a dynamic type in a method definition
|
2
17
|
def foo(a:dynamic)
|
3
18
|
puts "I got a #{a.getClass.getName} of size #{a.size}"
|
data/examples/edb.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
def_edb :render, 'test.edb'
|
2
17
|
@message = "Hello"
|
3
18
|
puts render
|
data/examples/fib.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
def fib(a:int)
|
2
17
|
if a < 2
|
3
18
|
a
|
data/examples/fields.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
import 'java.util.ArrayList'
|
2
17
|
|
3
18
|
class Bar
|
data/examples/fractal.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
def run
|
2
17
|
puts "Rendering"
|
3
18
|
y = -39.0
|
data/examples/java_thing.mirah
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
import "java.lang.System"
|
2
17
|
|
3
18
|
def foo
|
@@ -1,3 +1,18 @@
|
|
1
|
+
# Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
|
2
|
+
# All contributing project authors may be found in the NOTICE file.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
1
16
|
require 'ant'
|
2
17
|
require 'appengine-sdk'
|
3
18
|
|
@@ -9,7 +24,7 @@ TESTING_JARS = [AppEngine::SDK::API_JAR, AppEngine::SDK::LABS_JAR, JUNIT_JAR] +
|
|
9
24
|
AppEngine::SDK::RUNTIME_JARS.reject {|j| j =~ /appengine-local-runtime/}
|
10
25
|
TESTING_JARS.each {|jar| $CLASSPATH << jar}
|
11
26
|
|
12
|
-
#
|
27
|
+
# Mirah.compiler_options = ['-V']
|
13
28
|
|
14
29
|
task :default => :test
|
15
30
|
|
@@ -24,13 +39,13 @@ task :clean do
|
|
24
39
|
end
|
25
40
|
|
26
41
|
task :compile => :init do
|
27
|
-
# build the
|
28
|
-
puts "Compiling
|
42
|
+
# build the Mirah sources
|
43
|
+
puts "Compiling Mirah sources"
|
29
44
|
mirahc 'com/google/appengine', :dir => 'src', :dest => 'build'
|
30
45
|
end
|
31
46
|
|
32
47
|
task :compile_test => :jar do
|
33
|
-
puts "Compiling
|
48
|
+
puts "Compiling Mirah tests"
|
34
49
|
mirahc 'com/google/appengine', :dir => 'test', :dest => 'test',
|
35
50
|
:options => ['--classpath', Dir.pwd + "/dist/dubydatastore.jar"]
|
36
51
|
end
|