furnace-avm2 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/furnace-avm2/abc/metadata/instance_info.rb +5 -0
- data/lib/furnace-avm2/abc/metadata/klass_info.rb +9 -0
- data/lib/furnace-avm2/abc/metadata/method_body_info.rb +9 -6
- data/lib/furnace-avm2/abc/metadata/multiname_kind_qname.rb +1 -1
- data/lib/furnace-avm2/abc/metadata/ns_set_info.rb +1 -1
- data/lib/furnace-avm2/transform/ast_build.rb +1 -1
- data/lib/furnace-avm2/version.rb +1 -1
- metadata +6 -6
@@ -53,6 +53,11 @@ module Furnace::AVM2::ABC
|
|
53
53
|
root.children << AST::Node.new(:interfaces, interfaces.map(&:to_astlet))
|
54
54
|
end
|
55
55
|
|
56
|
+
if initializer
|
57
|
+
root.children << AST::Node.new(:initializer,
|
58
|
+
[ initializer.to_astlet(initializer_idx, name.to_astlet) ])
|
59
|
+
end
|
60
|
+
|
56
61
|
if traits.any?
|
57
62
|
root.children << AST::Node.new(:traits, traits.map(&:to_astlet))
|
58
63
|
end
|
@@ -6,6 +6,10 @@ module Furnace::AVM2::ABC
|
|
6
6
|
|
7
7
|
abc_array_of :trait, :nested, :class => TraitInfo
|
8
8
|
|
9
|
+
def instance
|
10
|
+
root.instances[root.klasses.index(self)]
|
11
|
+
end
|
12
|
+
|
9
13
|
def initializer_body
|
10
14
|
root.method_bodies.find { |body| body.method_idx == initializer_idx }
|
11
15
|
end
|
@@ -13,6 +17,11 @@ module Furnace::AVM2::ABC
|
|
13
17
|
def to_astlet
|
14
18
|
root = AST::Node.new(:klass)
|
15
19
|
|
20
|
+
if initializer
|
21
|
+
root.children << AST::Node.new(:initializer,
|
22
|
+
[ initializer.to_astlet(initializer_idx, instance.name.to_astlet) ])
|
23
|
+
end
|
24
|
+
|
16
25
|
if traits.any?
|
17
26
|
root.children << AST::Node.new(:traits, traits.map(&:to_astlet))
|
18
27
|
end
|
@@ -20,13 +20,16 @@ module Furnace::AVM2::ABC
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def code_to_ast
|
23
|
-
|
24
|
-
Furnace::
|
25
|
-
|
26
|
-
|
23
|
+
unless @ast
|
24
|
+
pipeline = Furnace::Transform::Pipeline.new([
|
25
|
+
Furnace::AVM2::Transform::ASTBuild.new(validate: true),
|
26
|
+
Furnace::AVM2::Transform::ASTNormalize.new
|
27
|
+
])
|
27
28
|
|
28
|
-
|
29
|
-
|
29
|
+
@ast, = pipeline.run(code, self)
|
30
|
+
end
|
31
|
+
|
32
|
+
@ast
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
data/lib/furnace-avm2/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: furnace-avm2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: furnace
|
16
|
-
requirement: &
|
16
|
+
requirement: &74548650 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.0.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *74548650
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: trollop
|
27
|
-
requirement: &
|
27
|
+
requirement: &74547750 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *74547750
|
36
36
|
description: furnace-avm2 allows one to load, modify and write back Flash ActionScript3
|
37
37
|
bytecode. It can also decompile it.
|
38
38
|
email:
|