opal 0.3.11 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +13 -0
- data/Gemfile +10 -0
- data/LICENSE +20 -0
- data/README.md +11 -116
- data/Rakefile +126 -0
- data/bin/opal +1 -2
- data/docs/spec_runner.html +16 -0
- data/index.html +434 -0
- data/lib/opal.rb +14 -15
- data/lib/opal/builder.rb +46 -148
- data/lib/opal/command.rb +45 -115
- data/lib/opal/context.rb +139 -78
- data/lib/opal/dependency_builder.rb +34 -0
- data/lib/opal/environment.rb +92 -0
- data/lib/opal/parser/grammar.rb +4915 -0
- data/lib/opal/{parser.y → parser/grammar.y} +430 -284
- data/lib/opal/parser/lexer.rb +1329 -0
- data/lib/opal/parser/parser.rb +1460 -0
- data/lib/opal/parser/scope.rb +140 -0
- data/lib/opal/parser/sexp.rb +17 -0
- data/lib/opal/version.rb +2 -1
- data/opal.gemspec +23 -0
- data/opal.js +3149 -4162
- data/runtime/README.md +25 -0
- data/runtime/corelib/alpha.rb +10 -0
- data/runtime/corelib/array.rb +962 -0
- data/runtime/corelib/basic_object.rb +66 -0
- data/runtime/corelib/boolean.rb +44 -0
- data/runtime/corelib/class.rb +43 -0
- data/runtime/corelib/comparable.rb +25 -0
- data/runtime/corelib/complex.rb +2 -0
- data/runtime/corelib/dir.rb +29 -0
- data/runtime/corelib/enumerable.rb +316 -0
- data/runtime/corelib/enumerator.rb +80 -0
- data/runtime/corelib/error.rb +25 -0
- data/runtime/corelib/file.rb +80 -0
- data/runtime/corelib/hash.rb +503 -0
- data/runtime/corelib/io.rb +44 -0
- data/runtime/corelib/kernel.rb +237 -0
- data/runtime/corelib/load_order +29 -0
- data/runtime/corelib/match_data.rb +37 -0
- data/runtime/corelib/module.rb +171 -0
- data/runtime/corelib/native.rb +50 -0
- data/runtime/corelib/nil_class.rb +47 -0
- data/runtime/corelib/numeric.rb +219 -0
- data/runtime/corelib/object.rb +21 -0
- data/runtime/corelib/proc.rb +42 -0
- data/runtime/corelib/range.rb +38 -0
- data/runtime/corelib/rational.rb +16 -0
- data/runtime/corelib/regexp.rb +63 -0
- data/runtime/corelib/string.rb +185 -0
- data/runtime/corelib/struct.rb +97 -0
- data/runtime/corelib/time.rb +196 -0
- data/runtime/corelib/top_self.rb +7 -0
- data/runtime/gemlib/alpha.rb +5 -0
- data/runtime/gemlib/kernel.rb +17 -0
- data/runtime/gemlib/load_order +2 -0
- data/runtime/kernel/class.js +256 -0
- data/runtime/kernel/debug.js +42 -0
- data/runtime/kernel/init.js +114 -0
- data/runtime/kernel/load_order +5 -0
- data/runtime/kernel/loader.js +151 -0
- data/runtime/kernel/runtime.js +414 -0
- data/runtime/spec/README.md +34 -0
- data/runtime/spec/core/array/allocate_spec.rb +15 -0
- data/runtime/spec/core/array/append_spec.rb +31 -0
- data/runtime/spec/core/array/assoc_spec.rb +29 -0
- data/runtime/spec/core/array/at_spec.rb +38 -0
- data/runtime/spec/core/array/clear_spec.rb +22 -0
- data/runtime/spec/core/array/collect_spec.rb +3 -0
- data/runtime/spec/core/array/compact_spec.rb +42 -0
- data/runtime/spec/core/array/concat_spec.rb +21 -0
- data/runtime/spec/core/array/constructor_spec.rb +24 -0
- data/runtime/spec/core/array/count_spec.rb +11 -0
- data/runtime/spec/core/array/delete_at_spec.rb +31 -0
- data/runtime/spec/core/array/delete_if_spec.rb +24 -0
- data/runtime/spec/core/array/delete_spec.rb +26 -0
- data/runtime/spec/core/array/each_index_spec.rb +33 -0
- data/runtime/spec/core/array/each_spec.rb +11 -0
- data/runtime/spec/core/array/element_reference_spec.rb +136 -0
- data/runtime/spec/core/array/element_set_spec.rb +7 -0
- data/runtime/spec/core/array/empty_spec.rb +10 -0
- data/runtime/spec/core/array/eql_spec.rb +3 -0
- data/runtime/spec/core/array/equal_value_spec.rb +3 -0
- data/runtime/spec/core/array/fetch_spec.rb +26 -0
- data/runtime/spec/core/array/first_spec.rb +54 -0
- data/runtime/spec/core/array/fixtures/classes.rb +8 -0
- data/runtime/spec/core/array/flatten_spec.rb +41 -0
- data/runtime/spec/core/array/include_spec.rb +20 -0
- data/runtime/spec/core/array/insert_spec.rb +59 -0
- data/runtime/spec/core/array/last_spec.rb +57 -0
- data/runtime/spec/core/array/length_spec.rb +3 -0
- data/runtime/spec/core/array/map_spec.rb +3 -0
- data/runtime/spec/core/array/plus_spec.rb +16 -0
- data/runtime/spec/core/array/pop_spec.rb +79 -0
- data/runtime/spec/core/array/push_spec.rb +19 -0
- data/runtime/spec/core/array/rassoc_spec.rb +12 -0
- data/runtime/spec/core/array/reject_spec.rb +54 -0
- data/runtime/spec/core/array/replace_spec.rb +3 -0
- data/runtime/spec/core/array/reverse_each_spec.rb +18 -0
- data/runtime/spec/core/array/reverse_spec.rb +9 -0
- data/runtime/spec/core/array/shared/collect.rb +53 -0
- data/runtime/spec/core/array/shared/eql.rb +19 -0
- data/runtime/spec/core/array/shared/length.rb +6 -0
- data/runtime/spec/core/array/shared/replace.rb +31 -0
- data/runtime/spec/core/class/new_spec.rb +19 -0
- data/runtime/spec/core/enumerable/all_spec.rb +102 -0
- data/runtime/spec/core/enumerable/any_spec.rb +115 -0
- data/runtime/spec/core/enumerable/collect_spec.rb +3 -0
- data/runtime/spec/core/enumerable/count_spec.rb +29 -0
- data/runtime/spec/core/enumerable/detect_spec.rb +3 -0
- data/runtime/spec/core/enumerable/find_spec.rb +3 -0
- data/runtime/spec/core/enumerable/fixtures/classes.rb +26 -0
- data/runtime/spec/core/enumerable/shared/collect.rb +12 -0
- data/runtime/spec/core/enumerable/shared/entries.rb +7 -0
- data/runtime/spec/core/enumerable/shared/find.rb +49 -0
- data/runtime/spec/core/enumerable/to_a_spec.rb +7 -0
- data/runtime/spec/core/false/and_spec.rb +11 -0
- data/runtime/spec/core/false/inspect_spec.rb +7 -0
- data/runtime/spec/core/false/or_spec.rb +11 -0
- data/runtime/spec/core/false/to_s_spec.rb +7 -0
- data/runtime/spec/core/false/xor_spec.rb +11 -0
- data/runtime/spec/core/hash/allocate_spec.rb +15 -0
- data/runtime/spec/core/hash/assoc_spec.rb +29 -0
- data/runtime/spec/core/hash/clear_spec.rb +21 -0
- data/runtime/spec/core/hash/clone_spec.rb +12 -0
- data/runtime/spec/core/hash/default_spec.rb +6 -0
- data/runtime/spec/core/hash/delete_if_spec.rb +15 -0
- data/runtime/spec/core/hash/element_reference_spec.rb +16 -0
- data/runtime/spec/core/hash/element_set_spec.rb +8 -0
- data/runtime/spec/core/hash/new_spec.rb +13 -0
- data/runtime/spec/core/matchdata/to_a_spec.rb +7 -0
- data/runtime/spec/core/nil/and_spec.rb +12 -0
- data/runtime/spec/core/nil/inspect_spec.rb +8 -0
- data/runtime/spec/core/nil/nil_spec.rb +8 -0
- data/runtime/spec/core/nil/or_spec.rb +12 -0
- data/runtime/spec/core/nil/to_a_spec.rb +8 -0
- data/runtime/spec/core/nil/to_f_spec.rb +12 -0
- data/runtime/spec/core/nil/to_i_spec.rb +12 -0
- data/runtime/spec/core/nil/to_s_spec.rb +8 -0
- data/runtime/spec/core/nil/xor_spec.rb +12 -0
- data/runtime/spec/core/numeric/equal_value_spec.rb +11 -0
- data/runtime/spec/core/object/is_a_spec.rb +2 -0
- data/runtime/spec/core/object/shared/kind_of.rb +0 -0
- data/runtime/spec/core/regexp/match_spec.rb +23 -0
- data/runtime/spec/core/regexp/shared/match.rb +11 -0
- data/runtime/spec/core/symbol/to_proc_spec.rb +8 -0
- data/runtime/spec/core/true/and_spec.rb +11 -0
- data/runtime/spec/core/true/inspect_spec.rb +7 -0
- data/runtime/spec/core/true/or_spec.rb +11 -0
- data/runtime/spec/core/true/to_s_spec.rb +7 -0
- data/runtime/spec/core/true/xor_spec.rb +11 -0
- data/runtime/spec/language/alias_spec.rb +25 -0
- data/runtime/spec/language/and_spec.rb +62 -0
- data/runtime/spec/language/array_spec.rb +68 -0
- data/runtime/spec/language/block_spec.rb +105 -0
- data/runtime/spec/language/break_spec.rb +49 -0
- data/runtime/spec/language/case_spec.rb +165 -0
- data/runtime/spec/language/defined_spec.rb +80 -0
- data/runtime/spec/language/ensure_spec.rb +82 -0
- data/runtime/spec/language/fixtures/block.rb +19 -0
- data/runtime/spec/language/fixtures/break.rb +39 -0
- data/runtime/spec/language/fixtures/defined.rb +9 -0
- data/runtime/spec/language/fixtures/ensure.rb +37 -0
- data/runtime/spec/language/fixtures/next.rb +46 -0
- data/runtime/spec/language/fixtures/send.rb +36 -0
- data/runtime/spec/language/fixtures/super.rb +43 -0
- data/runtime/spec/language/hash_spec.rb +43 -0
- data/runtime/spec/language/if_spec.rb +278 -0
- data/runtime/spec/language/loop_spec.rb +32 -0
- data/runtime/spec/language/next_spec.rb +128 -0
- data/runtime/spec/language/or_spec.rb +65 -0
- data/runtime/spec/language/predefined_spec.rb +21 -0
- data/runtime/spec/language/regexp/interpolation_spec.rb +9 -0
- data/runtime/spec/language/regexp_spec.rb +7 -0
- data/runtime/spec/language/send_spec.rb +105 -0
- data/runtime/spec/language/string_spec.rb +4 -0
- data/runtime/spec/language/super_spec.rb +18 -0
- data/runtime/spec/language/symbol_spec.rb +41 -0
- data/runtime/spec/language/undef_spec.rb +16 -0
- data/runtime/spec/language/unless_spec.rb +44 -0
- data/runtime/spec/language/until_spec.rb +137 -0
- data/runtime/spec/language/variables_spec.rb +28 -0
- data/runtime/spec/language/versions/hash_1.9.rb +20 -0
- data/runtime/spec/language/while_spec.rb +175 -0
- data/runtime/spec/library/stringscanner/scan_spec.rb +36 -0
- data/runtime/spec/opal/forwardable/def_instance_delegator_spec.rb +49 -0
- data/runtime/spec/opal/opal/defined_spec.rb +15 -0
- data/runtime/spec/opal/opal/function_spec.rb +11 -0
- data/runtime/spec/opal/opal/native_spec.rb +16 -0
- data/runtime/spec/opal/opal/null_spec.rb +10 -0
- data/runtime/spec/opal/opal/number_spec.rb +11 -0
- data/runtime/spec/opal/opal/object_spec.rb +16 -0
- data/runtime/spec/opal/opal/string_spec.rb +11 -0
- data/runtime/spec/opal/opal/typeof_spec.rb +9 -0
- data/runtime/spec/opal/opal/undefined_spec.rb +10 -0
- data/runtime/spec/opal/true/case_compare_spec.rb +12 -0
- data/runtime/spec/opal/true/class_spec.rb +10 -0
- data/runtime/spec/spec_helper.rb +25 -0
- data/runtime/stdlib/base64.rb +91 -0
- data/runtime/stdlib/date.rb +4 -0
- data/{stdlib → runtime/stdlib}/dev.rb +0 -0
- data/runtime/stdlib/forwardable.rb +33 -0
- data/runtime/stdlib/optparse.rb +0 -0
- data/runtime/stdlib/pp.rb +6 -0
- data/{stdlib → runtime/stdlib}/racc/parser.rb +0 -0
- data/runtime/stdlib/rbconfig.rb +0 -0
- data/runtime/stdlib/si.rb +17 -0
- data/runtime/stdlib/strscan.rb +53 -0
- data/runtime/stdlib/uri.rb +111 -0
- data/runtime/stdlib/uri/common.rb +1014 -0
- data/runtime/stdlib/uri/ftp.rb +261 -0
- data/runtime/stdlib/uri/generic.rb +1599 -0
- data/runtime/stdlib/uri/http.rb +106 -0
- data/runtime/stdlib/uri/https.rb +22 -0
- data/runtime/stdlib/uri/ldap.rb +260 -0
- data/runtime/stdlib/uri/ldaps.rb +20 -0
- data/runtime/stdlib/uri/mailto.rb +280 -0
- data/spec/builder/build_source_spec.rb +52 -0
- data/spec/builder/fixtures/build_source/adam.rb +0 -0
- data/spec/builder/fixtures/build_source/bar/a.rb +0 -0
- data/spec/builder/fixtures/build_source/bar/wow/b.rb +0 -0
- data/spec/builder/fixtures/build_source/bar/wow/cow/c.rb +0 -0
- data/spec/builder/fixtures/build_source/beynon.rb +0 -0
- data/spec/builder/fixtures/build_source/charles.js +0 -0
- data/spec/builder/fixtures/build_source/foo/a.rb +0 -0
- data/spec/builder/fixtures/build_source/foo/b.rb +0 -0
- data/spec/builder/fixtures/build_source/foo/x.js +0 -0
- data/spec/builder/fixtures/build_source/foo/y.js +0 -0
- data/spec/builder/output_path_spec.rb +50 -0
- data/spec/grammar/alias_spec.rb +26 -0
- data/spec/grammar/and_spec.rb +13 -0
- data/spec/grammar/array_spec.rb +22 -0
- data/spec/grammar/attrasgn_spec.rb +28 -0
- data/spec/grammar/begin_spec.rb +38 -0
- data/spec/grammar/block_spec.rb +12 -0
- data/spec/grammar/break_spec.rb +17 -0
- data/spec/grammar/call_spec.rb +58 -0
- data/spec/grammar/class_spec.rb +35 -0
- data/spec/grammar/const_spec.rb +13 -0
- data/spec/grammar/cvar_spec.rb +11 -0
- data/spec/grammar/def_spec.rb +60 -0
- data/spec/grammar/false_spec.rb +17 -0
- data/spec/grammar/file_spec.rb +7 -0
- data/spec/grammar/gvar_spec.rb +13 -0
- data/spec/grammar/hash_spec.rb +17 -0
- data/spec/grammar/iasgn_spec.rb +9 -0
- data/spec/grammar/if_spec.rb +26 -0
- data/spec/grammar/iter_spec.rb +59 -0
- data/spec/grammar/ivar_spec.rb +9 -0
- data/spec/grammar/lasgn_spec.rb +8 -0
- data/spec/grammar/line_spec.rb +8 -0
- data/spec/grammar/lvar_spec.rb +38 -0
- data/spec/grammar/module_spec.rb +27 -0
- data/spec/grammar/nil_spec.rb +17 -0
- data/spec/grammar/not_spec.rb +27 -0
- data/spec/grammar/op_asgn1_spec.rb +23 -0
- data/spec/grammar/op_asgn2_spec.rb +23 -0
- data/spec/grammar/or_spec.rb +13 -0
- data/spec/grammar/return_spec.rb +17 -0
- data/spec/grammar/sclass_spec.rb +20 -0
- data/spec/grammar/self_spec.rb +17 -0
- data/spec/grammar/str_spec.rb +96 -0
- data/spec/grammar/super_spec.rb +20 -0
- data/spec/grammar/true_spec.rb +17 -0
- data/spec/grammar/undef_spec.rb +15 -0
- data/spec/grammar/unless_spec.rb +13 -0
- data/spec/grammar/while_spec.rb +15 -0
- data/spec/grammar/xstr_spec.rb +116 -0
- data/spec/grammar/yield_spec.rb +20 -0
- data/spec/spec_helper.rb +9 -0
- metadata +346 -21
- data/lib/opal/bundle.rb +0 -34
- data/lib/opal/lexer.rb +0 -902
- data/lib/opal/nodes.rb +0 -2150
- data/lib/opal/parser.rb +0 -4894
- data/lib/opal/rake/bundle_task.rb +0 -63
- data/opal-parser.js +0 -8343
- data/stdlib/strscan.rb +0 -52
- data/templates/init/Rakefile +0 -7
- data/templates/init/index.html +0 -17
- data/templates/init/lib/__NAME__.rb +0 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The super keyword" do
|
|
4
|
+
it "should return s(:zsuper) when no arguments or parans" do
|
|
5
|
+
opal_parse("super").should == [:zsuper]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "should return s(:super) for any arguments" do
|
|
9
|
+
opal_parse("super 1").should == [:super, [:lit, 1]]
|
|
10
|
+
opal_parse("super 1, 2").should == [:super, [:lit, 1], [:lit, 2]]
|
|
11
|
+
opal_parse("super 1, *2").should == [:super, [:lit, 1], [:splat, [:lit, 2]]]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "should always return s(:super) when parans are used" do
|
|
15
|
+
opal_parse("super()").should == [:super]
|
|
16
|
+
opal_parse("super(1)").should == [:super, [:lit, 1]]
|
|
17
|
+
opal_parse("super(1, 2)").should == [:super, [:lit, 1], [:lit, 2]]
|
|
18
|
+
opal_parse("super(1, *2)").should == [:super, [:lit, 1], [:splat, [:lit, 2]]]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The true keyword" do
|
|
4
|
+
it "always returns s(:true)" do
|
|
5
|
+
opal_parse("true").should == [:true]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "cannot be assigned to" do
|
|
9
|
+
lambda {
|
|
10
|
+
opal_parse "true = 1"
|
|
11
|
+
}.should raise_error(Exception)
|
|
12
|
+
|
|
13
|
+
lambda {
|
|
14
|
+
opal_parse "true = true"
|
|
15
|
+
}.should raise_error(Exception)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The undef keyword" do
|
|
4
|
+
it "returns s(:undef) with the argument as an s(:lit)" do
|
|
5
|
+
opal_parse("undef a").should == [:undef, [:lit, :a]]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "appends multiple parts onto end of list" do
|
|
9
|
+
opal_parse("undef a, b").should == [:undef, [:lit, :a], [:lit, :b]]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "can take symbols or fitems" do
|
|
13
|
+
opal_parse("undef :foo").should == [:undef, [:lit, :foo]]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The unless keyword" do
|
|
4
|
+
it "returns s(:if) with reversed true and false bodies" do
|
|
5
|
+
opal_parse("unless 10; 20; end").should == [:if, [:lit, 10], nil, [:lit, 20]]
|
|
6
|
+
opal_parse("unless 10; 20; 30; end").should == [:if, [:lit, 10], nil, [:block, [:lit, 20], [:lit, 30]]]
|
|
7
|
+
opal_parse("unless 10; 20; else; 30; end").should == [:if, [:lit, 10], [:lit, 30], [:lit, 20]]
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "returns s(:if) with reversed true and false bodies for prefix unless" do
|
|
11
|
+
opal_parse("20 unless 10").should == [:if, [:lit, 10], nil, [:lit, 20]]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The while keyword" do
|
|
4
|
+
it "returns an s(:while) with the given expr, body and true for head" do
|
|
5
|
+
opal_parse("while 1; 2; end").should == [:while, [:lit, 1], [:lit, 2], true]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "uses an s(:block) if body has more than one statement" do
|
|
9
|
+
opal_parse("while 1; 2; 3; end").should == [:while, [:lit, 1], [:block, [:lit, 2], [:lit, 3]], true]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "treats the prefix while statement just like a regular while statement" do
|
|
13
|
+
opal_parse("1 while 2").should == [:while, [:lit, 2], [:lit, 1], true]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "x-strings" do
|
|
4
|
+
it "parses simple xstring as s(:xstr)" do
|
|
5
|
+
opal_parse("`foo`").should == [:xstr, "foo"]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "parses new lines within xstring" do
|
|
9
|
+
opal_parse("`\nfoo\n\nbar`").should == [:xstr, "\nfoo\n\nbar"]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "allows interpolation within xstring" do
|
|
13
|
+
opal_parse('`#{bar}`').should == [:dxstr, "", [:evstr, [:call, nil, :bar, [:arglist]]]]
|
|
14
|
+
opal_parse('`#{bar}#{baz}`').should == [:dxstr, "", [:evstr, [:call, nil, :bar, [:arglist]]], [:evstr, [:call, nil, :baz, [:arglist]]]]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "supports ivar interpolation" do
|
|
18
|
+
opal_parse('`#@foo`').should == [:dxstr, "", [:evstr, [:ivar, :@foo]]]
|
|
19
|
+
opal_parse('`#@foo.bar`').should == [:dxstr, "", [:evstr, [:ivar, :@foo]], [:str, ".bar"]]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "supports gvar interpolation" do
|
|
23
|
+
opal_parse('`#$foo`').should == [:dxstr, "", [:evstr, [:gvar, :$foo]]]
|
|
24
|
+
opal_parse('`#$foo.bar`').should == [:dxstr, "", [:evstr, [:gvar, :$foo]], [:str, ".bar"]]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "supports cvar interpolation" do
|
|
28
|
+
opal_parse('`#@@foo`').should == [:dxstr, "", [:evstr, [:cvar, :@@foo]]]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it "correctly parses block braces within interpolations" do
|
|
32
|
+
opal_parse('`#{ each { nil } }`').should == [:dxstr, "", [:evstr, [:iter, [:call, nil, :each, [:arglist]], nil, [:nil]]]]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "parses xstrings within interpolations" do
|
|
36
|
+
opal_parse('`#{ `bar` }`').should == [:dxstr, "", [:evstr, [:xstr, "bar"]]]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "parses multiple levels of interpolation" do
|
|
40
|
+
opal_parse('`#{ `#{`bar`}` }`').should == [:dxstr, "", [:evstr, [:dxstr, "", [:evstr, [:xstr, "bar"]]]]]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe "created using %x notation" do
|
|
44
|
+
it "can use '[', '(' or '{' matching pairs for string boundry" do
|
|
45
|
+
opal_parse('%x{foo}').should == [:xstr, "foo"]
|
|
46
|
+
opal_parse('%x[foo]').should == [:xstr, "foo"]
|
|
47
|
+
opal_parse('%x(foo)').should == [:xstr, "foo"]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "can parse empty strings" do
|
|
51
|
+
opal_parse('%x{}').should == [:xstr, ""]
|
|
52
|
+
opal_parse('%x[]').should == [:xstr, ""]
|
|
53
|
+
opal_parse('%x()').should == [:xstr, ""]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it "should allow interpolation" do
|
|
57
|
+
opal_parse('%x{#{foo}}').should == [:dxstr, "", [:evstr, [:call, nil, :foo, [:arglist]]]]
|
|
58
|
+
opal_parse('%x[#{foo}]').should == [:dxstr, "", [:evstr, [:call, nil, :foo, [:arglist]]]]
|
|
59
|
+
opal_parse('%x(#{foo})').should == [:dxstr, "", [:evstr, [:call, nil, :foo, [:arglist]]]]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
it "should allow ivar, gvar and cvar interpolation" do
|
|
63
|
+
opal_parse('%x{#@foo}').should == [:dxstr, "", [:evstr, [:ivar, :@foo]]]
|
|
64
|
+
opal_parse('%x{#$foo}').should == [:dxstr, "", [:evstr, [:gvar, :$foo]]]
|
|
65
|
+
opal_parse('%x{#@@foo}').should == [:dxstr, "", [:evstr, [:cvar, :@@foo]]]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it "should match '{' and '}' pairs used to start string before ending match" do
|
|
69
|
+
opal_parse('%x{{}}').should == [:xstr, "{}"]
|
|
70
|
+
opal_parse('%x{foo{bar}baz}').should == [:xstr, "foo{bar}baz"]
|
|
71
|
+
opal_parse('%x{{foo}bar}').should == [:xstr, "{foo}bar"]
|
|
72
|
+
opal_parse('%x{foo{bar}}').should == [:xstr, "foo{bar}"]
|
|
73
|
+
opal_parse('%x{foo#{bar}baz}').should == [:dxstr, "foo", [:evstr, [:call, nil, :bar, [:arglist]]], [:str, "baz"]]
|
|
74
|
+
opal_parse('%x{a{b{c}d{e}f}g}').should == [:xstr, "a{b{c}d{e}f}g"]
|
|
75
|
+
opal_parse('%x{a{b{c}#{foo}d}e}').should == [:dxstr, "a{b{c}", [:evstr, [:call, nil, :foo, [:arglist]]], [:str, "d}e"]]
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it "should match '(' and ')' pairs used to start string before ending match" do
|
|
79
|
+
opal_parse('%x(())').should == [:xstr, "()"]
|
|
80
|
+
opal_parse('%x(foo(bar)baz)').should == [:xstr, "foo(bar)baz"]
|
|
81
|
+
opal_parse('%x((foo)bar)').should == [:xstr, "(foo)bar"]
|
|
82
|
+
opal_parse('%x(foo(bar))').should == [:xstr, "foo(bar)"]
|
|
83
|
+
opal_parse('%x(foo#{bar}baz)').should == [:dxstr, "foo", [:evstr, [:call, nil, :bar, [:arglist]]], [:str, "baz"]]
|
|
84
|
+
opal_parse('%x(a(b(c)d(e)f)g)').should == [:xstr, "a(b(c)d(e)f)g"]
|
|
85
|
+
opal_parse('%x(a(b(c)#{foo}d)e)').should == [:dxstr, "a(b(c)", [:evstr, [:call, nil, :foo, [:arglist]]], [:str, "d)e"]]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it "should match '[' and ']' pairs used to start string before ending match" do
|
|
89
|
+
opal_parse('%x[[]]').should == [:xstr, "[]"]
|
|
90
|
+
opal_parse('%x[foo[bar]baz]').should == [:xstr, "foo[bar]baz"]
|
|
91
|
+
opal_parse('%x[[foo]bar]').should == [:xstr, "[foo]bar"]
|
|
92
|
+
opal_parse('%x[foo[bar]]').should == [:xstr, "foo[bar]"]
|
|
93
|
+
opal_parse('%x[foo#{bar}baz]').should == [:dxstr, "foo", [:evstr, [:call, nil, :bar, [:arglist]]], [:str, "baz"]]
|
|
94
|
+
opal_parse('%x[a[b[c]d[e]f]g]').should == [:xstr, "a[b[c]d[e]f]g"]
|
|
95
|
+
opal_parse('%x[a[b[c]#{foo}d]e]').should == [:dxstr, "a[b[c]", [:evstr, [:call, nil, :foo, [:arglist]]], [:str, "d]e"]]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it "correctly parses block braces within interpolations" do
|
|
99
|
+
opal_parse('%x{#{each { nil } }}').should == [:dxstr, "", [:evstr, [:iter, [:call, nil, :each, [:arglist]], nil, [:nil]]]]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it "parses other Xstrings within interpolations" do
|
|
103
|
+
opal_parse('%x{#{ %x{} }}').should == [:dxstr, "", [:evstr, [:xstr, ""]]]
|
|
104
|
+
opal_parse('%x{#{ `` }}').should == [:dxstr, "", [:evstr, [:xstr, ""]]]
|
|
105
|
+
opal_parse('%x{#{ `foo` }}').should == [:dxstr, "", [:evstr, [:xstr, "foo"]]]
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
describe "cannot be created with %X notation" do
|
|
110
|
+
it "should not parse" do
|
|
111
|
+
lambda {
|
|
112
|
+
opal_parse('%X{}')
|
|
113
|
+
}.should raise_error(Exception)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe "The yield keyword" do
|
|
4
|
+
it "should return s(:yield) when no arguments given" do
|
|
5
|
+
opal_parse("yield").should == [:yield]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "appends arguments onto end of s(:yield) without an arglist" do
|
|
9
|
+
opal_parse("yield 1").should == [:yield, [:lit, 1]]
|
|
10
|
+
opal_parse("yield 1, 2").should == [:yield, [:lit, 1], [:lit, 2]]
|
|
11
|
+
opal_parse("yield 1, *2").should == [:yield, [:lit, 1], [:splat, [:lit, 2]]]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "accepts parans for any number of arguments" do
|
|
15
|
+
opal_parse("yield()").should == [:yield]
|
|
16
|
+
opal_parse("yield(1)").should == [:yield, [:lit, 1]]
|
|
17
|
+
opal_parse("yield(1, 2)").should == [:yield, [:lit, 1], [:lit, 2]]
|
|
18
|
+
opal_parse("yield(1, *2)").should == [:yield, [:lit, 1], [:splat, [:lit, 2]]]
|
|
19
|
+
end
|
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.15
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,37 +9,309 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
-
dependencies:
|
|
12
|
+
date: 2012-01-06 00:00:00.000000000Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: racc
|
|
16
|
+
requirement: &2154343380 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '0'
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *2154343380
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: therubyracer
|
|
27
|
+
requirement: &2154342960 !ruby/object:Gem::Requirement
|
|
28
|
+
none: false
|
|
29
|
+
requirements:
|
|
30
|
+
- - ! '>='
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: *2154342960
|
|
14
36
|
description: Ruby runtime and core library for javascript.
|
|
15
|
-
email:
|
|
16
|
-
- adam@adambeynon.com
|
|
37
|
+
email: adam@adambeynon.com
|
|
17
38
|
executables:
|
|
18
39
|
- opal
|
|
19
40
|
extensions: []
|
|
20
41
|
extra_rdoc_files: []
|
|
21
42
|
files:
|
|
43
|
+
- .gitignore
|
|
44
|
+
- Gemfile
|
|
45
|
+
- LICENSE
|
|
46
|
+
- README.md
|
|
47
|
+
- Rakefile
|
|
22
48
|
- bin/opal
|
|
49
|
+
- docs/spec_runner.html
|
|
50
|
+
- index.html
|
|
51
|
+
- lib/opal.rb
|
|
23
52
|
- lib/opal/builder.rb
|
|
24
|
-
- lib/opal/bundle.rb
|
|
25
53
|
- lib/opal/command.rb
|
|
26
54
|
- lib/opal/context.rb
|
|
27
|
-
- lib/opal/
|
|
28
|
-
- lib/opal/
|
|
29
|
-
- lib/opal/parser.rb
|
|
30
|
-
- lib/opal/parser.y
|
|
31
|
-
- lib/opal/
|
|
55
|
+
- lib/opal/dependency_builder.rb
|
|
56
|
+
- lib/opal/environment.rb
|
|
57
|
+
- lib/opal/parser/grammar.rb
|
|
58
|
+
- lib/opal/parser/grammar.y
|
|
59
|
+
- lib/opal/parser/lexer.rb
|
|
60
|
+
- lib/opal/parser/parser.rb
|
|
61
|
+
- lib/opal/parser/scope.rb
|
|
62
|
+
- lib/opal/parser/sexp.rb
|
|
32
63
|
- lib/opal/version.rb
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
64
|
+
- opal.gemspec
|
|
65
|
+
- runtime/README.md
|
|
66
|
+
- runtime/corelib/alpha.rb
|
|
67
|
+
- runtime/corelib/array.rb
|
|
68
|
+
- runtime/corelib/basic_object.rb
|
|
69
|
+
- runtime/corelib/boolean.rb
|
|
70
|
+
- runtime/corelib/class.rb
|
|
71
|
+
- runtime/corelib/comparable.rb
|
|
72
|
+
- runtime/corelib/complex.rb
|
|
73
|
+
- runtime/corelib/dir.rb
|
|
74
|
+
- runtime/corelib/enumerable.rb
|
|
75
|
+
- runtime/corelib/enumerator.rb
|
|
76
|
+
- runtime/corelib/error.rb
|
|
77
|
+
- runtime/corelib/file.rb
|
|
78
|
+
- runtime/corelib/hash.rb
|
|
79
|
+
- runtime/corelib/io.rb
|
|
80
|
+
- runtime/corelib/kernel.rb
|
|
81
|
+
- runtime/corelib/load_order
|
|
82
|
+
- runtime/corelib/match_data.rb
|
|
83
|
+
- runtime/corelib/module.rb
|
|
84
|
+
- runtime/corelib/native.rb
|
|
85
|
+
- runtime/corelib/nil_class.rb
|
|
86
|
+
- runtime/corelib/numeric.rb
|
|
87
|
+
- runtime/corelib/object.rb
|
|
88
|
+
- runtime/corelib/proc.rb
|
|
89
|
+
- runtime/corelib/range.rb
|
|
90
|
+
- runtime/corelib/rational.rb
|
|
91
|
+
- runtime/corelib/regexp.rb
|
|
92
|
+
- runtime/corelib/string.rb
|
|
93
|
+
- runtime/corelib/struct.rb
|
|
94
|
+
- runtime/corelib/time.rb
|
|
95
|
+
- runtime/corelib/top_self.rb
|
|
96
|
+
- runtime/gemlib/alpha.rb
|
|
97
|
+
- runtime/gemlib/kernel.rb
|
|
98
|
+
- runtime/gemlib/load_order
|
|
99
|
+
- runtime/kernel/class.js
|
|
100
|
+
- runtime/kernel/debug.js
|
|
101
|
+
- runtime/kernel/init.js
|
|
102
|
+
- runtime/kernel/load_order
|
|
103
|
+
- runtime/kernel/loader.js
|
|
104
|
+
- runtime/kernel/runtime.js
|
|
105
|
+
- runtime/spec/README.md
|
|
106
|
+
- runtime/spec/core/array/allocate_spec.rb
|
|
107
|
+
- runtime/spec/core/array/append_spec.rb
|
|
108
|
+
- runtime/spec/core/array/assoc_spec.rb
|
|
109
|
+
- runtime/spec/core/array/at_spec.rb
|
|
110
|
+
- runtime/spec/core/array/clear_spec.rb
|
|
111
|
+
- runtime/spec/core/array/collect_spec.rb
|
|
112
|
+
- runtime/spec/core/array/compact_spec.rb
|
|
113
|
+
- runtime/spec/core/array/concat_spec.rb
|
|
114
|
+
- runtime/spec/core/array/constructor_spec.rb
|
|
115
|
+
- runtime/spec/core/array/count_spec.rb
|
|
116
|
+
- runtime/spec/core/array/delete_at_spec.rb
|
|
117
|
+
- runtime/spec/core/array/delete_if_spec.rb
|
|
118
|
+
- runtime/spec/core/array/delete_spec.rb
|
|
119
|
+
- runtime/spec/core/array/each_index_spec.rb
|
|
120
|
+
- runtime/spec/core/array/each_spec.rb
|
|
121
|
+
- runtime/spec/core/array/element_reference_spec.rb
|
|
122
|
+
- runtime/spec/core/array/element_set_spec.rb
|
|
123
|
+
- runtime/spec/core/array/empty_spec.rb
|
|
124
|
+
- runtime/spec/core/array/eql_spec.rb
|
|
125
|
+
- runtime/spec/core/array/equal_value_spec.rb
|
|
126
|
+
- runtime/spec/core/array/fetch_spec.rb
|
|
127
|
+
- runtime/spec/core/array/first_spec.rb
|
|
128
|
+
- runtime/spec/core/array/fixtures/classes.rb
|
|
129
|
+
- runtime/spec/core/array/flatten_spec.rb
|
|
130
|
+
- runtime/spec/core/array/include_spec.rb
|
|
131
|
+
- runtime/spec/core/array/insert_spec.rb
|
|
132
|
+
- runtime/spec/core/array/last_spec.rb
|
|
133
|
+
- runtime/spec/core/array/length_spec.rb
|
|
134
|
+
- runtime/spec/core/array/map_spec.rb
|
|
135
|
+
- runtime/spec/core/array/plus_spec.rb
|
|
136
|
+
- runtime/spec/core/array/pop_spec.rb
|
|
137
|
+
- runtime/spec/core/array/push_spec.rb
|
|
138
|
+
- runtime/spec/core/array/rassoc_spec.rb
|
|
139
|
+
- runtime/spec/core/array/reject_spec.rb
|
|
140
|
+
- runtime/spec/core/array/replace_spec.rb
|
|
141
|
+
- runtime/spec/core/array/reverse_each_spec.rb
|
|
142
|
+
- runtime/spec/core/array/reverse_spec.rb
|
|
143
|
+
- runtime/spec/core/array/shared/collect.rb
|
|
144
|
+
- runtime/spec/core/array/shared/eql.rb
|
|
145
|
+
- runtime/spec/core/array/shared/length.rb
|
|
146
|
+
- runtime/spec/core/array/shared/replace.rb
|
|
147
|
+
- runtime/spec/core/class/new_spec.rb
|
|
148
|
+
- runtime/spec/core/enumerable/all_spec.rb
|
|
149
|
+
- runtime/spec/core/enumerable/any_spec.rb
|
|
150
|
+
- runtime/spec/core/enumerable/collect_spec.rb
|
|
151
|
+
- runtime/spec/core/enumerable/count_spec.rb
|
|
152
|
+
- runtime/spec/core/enumerable/detect_spec.rb
|
|
153
|
+
- runtime/spec/core/enumerable/find_spec.rb
|
|
154
|
+
- runtime/spec/core/enumerable/fixtures/classes.rb
|
|
155
|
+
- runtime/spec/core/enumerable/shared/collect.rb
|
|
156
|
+
- runtime/spec/core/enumerable/shared/entries.rb
|
|
157
|
+
- runtime/spec/core/enumerable/shared/find.rb
|
|
158
|
+
- runtime/spec/core/enumerable/to_a_spec.rb
|
|
159
|
+
- runtime/spec/core/false/and_spec.rb
|
|
160
|
+
- runtime/spec/core/false/inspect_spec.rb
|
|
161
|
+
- runtime/spec/core/false/or_spec.rb
|
|
162
|
+
- runtime/spec/core/false/to_s_spec.rb
|
|
163
|
+
- runtime/spec/core/false/xor_spec.rb
|
|
164
|
+
- runtime/spec/core/hash/allocate_spec.rb
|
|
165
|
+
- runtime/spec/core/hash/assoc_spec.rb
|
|
166
|
+
- runtime/spec/core/hash/clear_spec.rb
|
|
167
|
+
- runtime/spec/core/hash/clone_spec.rb
|
|
168
|
+
- runtime/spec/core/hash/default_spec.rb
|
|
169
|
+
- runtime/spec/core/hash/delete_if_spec.rb
|
|
170
|
+
- runtime/spec/core/hash/element_reference_spec.rb
|
|
171
|
+
- runtime/spec/core/hash/element_set_spec.rb
|
|
172
|
+
- runtime/spec/core/hash/new_spec.rb
|
|
173
|
+
- runtime/spec/core/matchdata/to_a_spec.rb
|
|
174
|
+
- runtime/spec/core/nil/and_spec.rb
|
|
175
|
+
- runtime/spec/core/nil/inspect_spec.rb
|
|
176
|
+
- runtime/spec/core/nil/nil_spec.rb
|
|
177
|
+
- runtime/spec/core/nil/or_spec.rb
|
|
178
|
+
- runtime/spec/core/nil/to_a_spec.rb
|
|
179
|
+
- runtime/spec/core/nil/to_f_spec.rb
|
|
180
|
+
- runtime/spec/core/nil/to_i_spec.rb
|
|
181
|
+
- runtime/spec/core/nil/to_s_spec.rb
|
|
182
|
+
- runtime/spec/core/nil/xor_spec.rb
|
|
183
|
+
- runtime/spec/core/numeric/equal_value_spec.rb
|
|
184
|
+
- runtime/spec/core/object/is_a_spec.rb
|
|
185
|
+
- runtime/spec/core/object/shared/kind_of.rb
|
|
186
|
+
- runtime/spec/core/regexp/match_spec.rb
|
|
187
|
+
- runtime/spec/core/regexp/shared/match.rb
|
|
188
|
+
- runtime/spec/core/symbol/to_proc_spec.rb
|
|
189
|
+
- runtime/spec/core/true/and_spec.rb
|
|
190
|
+
- runtime/spec/core/true/inspect_spec.rb
|
|
191
|
+
- runtime/spec/core/true/or_spec.rb
|
|
192
|
+
- runtime/spec/core/true/to_s_spec.rb
|
|
193
|
+
- runtime/spec/core/true/xor_spec.rb
|
|
194
|
+
- runtime/spec/language/alias_spec.rb
|
|
195
|
+
- runtime/spec/language/and_spec.rb
|
|
196
|
+
- runtime/spec/language/array_spec.rb
|
|
197
|
+
- runtime/spec/language/block_spec.rb
|
|
198
|
+
- runtime/spec/language/break_spec.rb
|
|
199
|
+
- runtime/spec/language/case_spec.rb
|
|
200
|
+
- runtime/spec/language/defined_spec.rb
|
|
201
|
+
- runtime/spec/language/ensure_spec.rb
|
|
202
|
+
- runtime/spec/language/fixtures/block.rb
|
|
203
|
+
- runtime/spec/language/fixtures/break.rb
|
|
204
|
+
- runtime/spec/language/fixtures/defined.rb
|
|
205
|
+
- runtime/spec/language/fixtures/ensure.rb
|
|
206
|
+
- runtime/spec/language/fixtures/next.rb
|
|
207
|
+
- runtime/spec/language/fixtures/send.rb
|
|
208
|
+
- runtime/spec/language/fixtures/super.rb
|
|
209
|
+
- runtime/spec/language/hash_spec.rb
|
|
210
|
+
- runtime/spec/language/if_spec.rb
|
|
211
|
+
- runtime/spec/language/loop_spec.rb
|
|
212
|
+
- runtime/spec/language/next_spec.rb
|
|
213
|
+
- runtime/spec/language/or_spec.rb
|
|
214
|
+
- runtime/spec/language/predefined_spec.rb
|
|
215
|
+
- runtime/spec/language/regexp/interpolation_spec.rb
|
|
216
|
+
- runtime/spec/language/regexp_spec.rb
|
|
217
|
+
- runtime/spec/language/send_spec.rb
|
|
218
|
+
- runtime/spec/language/string_spec.rb
|
|
219
|
+
- runtime/spec/language/super_spec.rb
|
|
220
|
+
- runtime/spec/language/symbol_spec.rb
|
|
221
|
+
- runtime/spec/language/undef_spec.rb
|
|
222
|
+
- runtime/spec/language/unless_spec.rb
|
|
223
|
+
- runtime/spec/language/until_spec.rb
|
|
224
|
+
- runtime/spec/language/variables_spec.rb
|
|
225
|
+
- runtime/spec/language/versions/hash_1.9.rb
|
|
226
|
+
- runtime/spec/language/while_spec.rb
|
|
227
|
+
- runtime/spec/library/stringscanner/scan_spec.rb
|
|
228
|
+
- runtime/spec/opal/forwardable/def_instance_delegator_spec.rb
|
|
229
|
+
- runtime/spec/opal/opal/defined_spec.rb
|
|
230
|
+
- runtime/spec/opal/opal/function_spec.rb
|
|
231
|
+
- runtime/spec/opal/opal/native_spec.rb
|
|
232
|
+
- runtime/spec/opal/opal/null_spec.rb
|
|
233
|
+
- runtime/spec/opal/opal/number_spec.rb
|
|
234
|
+
- runtime/spec/opal/opal/object_spec.rb
|
|
235
|
+
- runtime/spec/opal/opal/string_spec.rb
|
|
236
|
+
- runtime/spec/opal/opal/typeof_spec.rb
|
|
237
|
+
- runtime/spec/opal/opal/undefined_spec.rb
|
|
238
|
+
- runtime/spec/opal/true/case_compare_spec.rb
|
|
239
|
+
- runtime/spec/opal/true/class_spec.rb
|
|
240
|
+
- runtime/spec/spec_helper.rb
|
|
241
|
+
- runtime/stdlib/base64.rb
|
|
242
|
+
- runtime/stdlib/date.rb
|
|
243
|
+
- runtime/stdlib/dev.rb
|
|
244
|
+
- runtime/stdlib/forwardable.rb
|
|
245
|
+
- runtime/stdlib/optparse.rb
|
|
246
|
+
- runtime/stdlib/pp.rb
|
|
247
|
+
- runtime/stdlib/racc/parser.rb
|
|
248
|
+
- runtime/stdlib/rbconfig.rb
|
|
249
|
+
- runtime/stdlib/si.rb
|
|
250
|
+
- runtime/stdlib/strscan.rb
|
|
251
|
+
- runtime/stdlib/uri.rb
|
|
252
|
+
- runtime/stdlib/uri/common.rb
|
|
253
|
+
- runtime/stdlib/uri/ftp.rb
|
|
254
|
+
- runtime/stdlib/uri/generic.rb
|
|
255
|
+
- runtime/stdlib/uri/http.rb
|
|
256
|
+
- runtime/stdlib/uri/https.rb
|
|
257
|
+
- runtime/stdlib/uri/ldap.rb
|
|
258
|
+
- runtime/stdlib/uri/ldaps.rb
|
|
259
|
+
- runtime/stdlib/uri/mailto.rb
|
|
260
|
+
- spec/builder/build_source_spec.rb
|
|
261
|
+
- spec/builder/fixtures/build_source/adam.rb
|
|
262
|
+
- spec/builder/fixtures/build_source/bar/a.rb
|
|
263
|
+
- spec/builder/fixtures/build_source/bar/wow/b.rb
|
|
264
|
+
- spec/builder/fixtures/build_source/bar/wow/cow/c.rb
|
|
265
|
+
- spec/builder/fixtures/build_source/beynon.rb
|
|
266
|
+
- spec/builder/fixtures/build_source/charles.js
|
|
267
|
+
- spec/builder/fixtures/build_source/foo/a.rb
|
|
268
|
+
- spec/builder/fixtures/build_source/foo/b.rb
|
|
269
|
+
- spec/builder/fixtures/build_source/foo/x.js
|
|
270
|
+
- spec/builder/fixtures/build_source/foo/y.js
|
|
271
|
+
- spec/builder/output_path_spec.rb
|
|
272
|
+
- spec/grammar/alias_spec.rb
|
|
273
|
+
- spec/grammar/and_spec.rb
|
|
274
|
+
- spec/grammar/array_spec.rb
|
|
275
|
+
- spec/grammar/attrasgn_spec.rb
|
|
276
|
+
- spec/grammar/begin_spec.rb
|
|
277
|
+
- spec/grammar/block_spec.rb
|
|
278
|
+
- spec/grammar/break_spec.rb
|
|
279
|
+
- spec/grammar/call_spec.rb
|
|
280
|
+
- spec/grammar/class_spec.rb
|
|
281
|
+
- spec/grammar/const_spec.rb
|
|
282
|
+
- spec/grammar/cvar_spec.rb
|
|
283
|
+
- spec/grammar/def_spec.rb
|
|
284
|
+
- spec/grammar/false_spec.rb
|
|
285
|
+
- spec/grammar/file_spec.rb
|
|
286
|
+
- spec/grammar/gvar_spec.rb
|
|
287
|
+
- spec/grammar/hash_spec.rb
|
|
288
|
+
- spec/grammar/iasgn_spec.rb
|
|
289
|
+
- spec/grammar/if_spec.rb
|
|
290
|
+
- spec/grammar/iter_spec.rb
|
|
291
|
+
- spec/grammar/ivar_spec.rb
|
|
292
|
+
- spec/grammar/lasgn_spec.rb
|
|
293
|
+
- spec/grammar/line_spec.rb
|
|
294
|
+
- spec/grammar/lvar_spec.rb
|
|
295
|
+
- spec/grammar/module_spec.rb
|
|
296
|
+
- spec/grammar/nil_spec.rb
|
|
297
|
+
- spec/grammar/not_spec.rb
|
|
298
|
+
- spec/grammar/op_asgn1_spec.rb
|
|
299
|
+
- spec/grammar/op_asgn2_spec.rb
|
|
300
|
+
- spec/grammar/or_spec.rb
|
|
301
|
+
- spec/grammar/return_spec.rb
|
|
302
|
+
- spec/grammar/sclass_spec.rb
|
|
303
|
+
- spec/grammar/self_spec.rb
|
|
304
|
+
- spec/grammar/str_spec.rb
|
|
305
|
+
- spec/grammar/super_spec.rb
|
|
306
|
+
- spec/grammar/true_spec.rb
|
|
307
|
+
- spec/grammar/undef_spec.rb
|
|
308
|
+
- spec/grammar/unless_spec.rb
|
|
309
|
+
- spec/grammar/while_spec.rb
|
|
310
|
+
- spec/grammar/xstr_spec.rb
|
|
311
|
+
- spec/grammar/yield_spec.rb
|
|
312
|
+
- spec/spec_helper.rb
|
|
41
313
|
- opal.js
|
|
42
|
-
- opal
|
|
314
|
+
- opal.debug.js
|
|
43
315
|
homepage: http://opalscript.org
|
|
44
316
|
licenses: []
|
|
45
317
|
post_install_message:
|
|
@@ -64,4 +336,57 @@ rubygems_version: 1.8.10
|
|
|
64
336
|
signing_key:
|
|
65
337
|
specification_version: 3
|
|
66
338
|
summary: Ruby runtime and core library for javascript
|
|
67
|
-
test_files:
|
|
339
|
+
test_files:
|
|
340
|
+
- spec/builder/build_source_spec.rb
|
|
341
|
+
- spec/builder/fixtures/build_source/adam.rb
|
|
342
|
+
- spec/builder/fixtures/build_source/bar/a.rb
|
|
343
|
+
- spec/builder/fixtures/build_source/bar/wow/b.rb
|
|
344
|
+
- spec/builder/fixtures/build_source/bar/wow/cow/c.rb
|
|
345
|
+
- spec/builder/fixtures/build_source/beynon.rb
|
|
346
|
+
- spec/builder/fixtures/build_source/charles.js
|
|
347
|
+
- spec/builder/fixtures/build_source/foo/a.rb
|
|
348
|
+
- spec/builder/fixtures/build_source/foo/b.rb
|
|
349
|
+
- spec/builder/fixtures/build_source/foo/x.js
|
|
350
|
+
- spec/builder/fixtures/build_source/foo/y.js
|
|
351
|
+
- spec/builder/output_path_spec.rb
|
|
352
|
+
- spec/grammar/alias_spec.rb
|
|
353
|
+
- spec/grammar/and_spec.rb
|
|
354
|
+
- spec/grammar/array_spec.rb
|
|
355
|
+
- spec/grammar/attrasgn_spec.rb
|
|
356
|
+
- spec/grammar/begin_spec.rb
|
|
357
|
+
- spec/grammar/block_spec.rb
|
|
358
|
+
- spec/grammar/break_spec.rb
|
|
359
|
+
- spec/grammar/call_spec.rb
|
|
360
|
+
- spec/grammar/class_spec.rb
|
|
361
|
+
- spec/grammar/const_spec.rb
|
|
362
|
+
- spec/grammar/cvar_spec.rb
|
|
363
|
+
- spec/grammar/def_spec.rb
|
|
364
|
+
- spec/grammar/false_spec.rb
|
|
365
|
+
- spec/grammar/file_spec.rb
|
|
366
|
+
- spec/grammar/gvar_spec.rb
|
|
367
|
+
- spec/grammar/hash_spec.rb
|
|
368
|
+
- spec/grammar/iasgn_spec.rb
|
|
369
|
+
- spec/grammar/if_spec.rb
|
|
370
|
+
- spec/grammar/iter_spec.rb
|
|
371
|
+
- spec/grammar/ivar_spec.rb
|
|
372
|
+
- spec/grammar/lasgn_spec.rb
|
|
373
|
+
- spec/grammar/line_spec.rb
|
|
374
|
+
- spec/grammar/lvar_spec.rb
|
|
375
|
+
- spec/grammar/module_spec.rb
|
|
376
|
+
- spec/grammar/nil_spec.rb
|
|
377
|
+
- spec/grammar/not_spec.rb
|
|
378
|
+
- spec/grammar/op_asgn1_spec.rb
|
|
379
|
+
- spec/grammar/op_asgn2_spec.rb
|
|
380
|
+
- spec/grammar/or_spec.rb
|
|
381
|
+
- spec/grammar/return_spec.rb
|
|
382
|
+
- spec/grammar/sclass_spec.rb
|
|
383
|
+
- spec/grammar/self_spec.rb
|
|
384
|
+
- spec/grammar/str_spec.rb
|
|
385
|
+
- spec/grammar/super_spec.rb
|
|
386
|
+
- spec/grammar/true_spec.rb
|
|
387
|
+
- spec/grammar/undef_spec.rb
|
|
388
|
+
- spec/grammar/unless_spec.rb
|
|
389
|
+
- spec/grammar/while_spec.rb
|
|
390
|
+
- spec/grammar/xstr_spec.rb
|
|
391
|
+
- spec/grammar/yield_spec.rb
|
|
392
|
+
- spec/spec_helper.rb
|