masamune-ast 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +4 -1
- data/README.md +30 -82
- data/lib/masamune/abstract_syntax_tree/prism/node_extensions.rb +82 -0
- data/lib/masamune/abstract_syntax_tree/visitors/block_parameters_visitor.rb +18 -0
- data/lib/masamune/abstract_syntax_tree/visitors/method_calls_visitor.rb +19 -0
- data/lib/masamune/abstract_syntax_tree/visitors/method_definitions_visitor.rb +17 -0
- data/lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb +18 -0
- data/lib/masamune/abstract_syntax_tree/visitors/strings_visitor.rb +17 -0
- data/lib/masamune/abstract_syntax_tree/visitors/symbols_visitor.rb +17 -0
- data/lib/masamune/abstract_syntax_tree/visitors/variables_visitor.rb +34 -0
- data/lib/masamune/abstract_syntax_tree.rb +57 -134
- data/lib/masamune/lex_node.rb +6 -6
- data/lib/masamune/slasher.rb +9 -15
- data/lib/masamune/version.rb +1 -1
- data/lib/masamune.rb +10 -22
- metadata +29 -27
- data/lib/masamune/abstract_syntax_tree/data_node.rb +0 -49
- data/lib/masamune/abstract_syntax_tree/node.rb +0 -41
- data/lib/masamune/abstract_syntax_tree/nodes/assign.rb +0 -11
- data/lib/masamune/abstract_syntax_tree/nodes/blocks/brace_block.rb +0 -13
- data/lib/masamune/abstract_syntax_tree/nodes/blocks/do_block.rb +0 -13
- data/lib/masamune/abstract_syntax_tree/nodes/call.rb +0 -17
- data/lib/masamune/abstract_syntax_tree/nodes/command.rb +0 -64
- data/lib/masamune/abstract_syntax_tree/nodes/def.rb +0 -17
- data/lib/masamune/abstract_syntax_tree/nodes/params.rb +0 -23
- data/lib/masamune/abstract_syntax_tree/nodes/program.rb +0 -16
- data/lib/masamune/abstract_syntax_tree/nodes/string_content.rb +0 -17
- data/lib/masamune/abstract_syntax_tree/nodes/support_nodes/block.rb +0 -18
- data/lib/masamune/abstract_syntax_tree/nodes/support_nodes/comment.rb +0 -25
- data/lib/masamune/abstract_syntax_tree/nodes/symbol.rb +0 -17
- data/lib/masamune/abstract_syntax_tree/nodes/symbols/dyna_symbol.rb +0 -20
- data/lib/masamune/abstract_syntax_tree/nodes/symbols/symbol_literal.rb +0 -21
- data/lib/masamune/abstract_syntax_tree/nodes/variables/block_var.rb +0 -22
- data/lib/masamune/abstract_syntax_tree/nodes/variables/var_field.rb +0 -17
- data/lib/masamune/abstract_syntax_tree/nodes/variables/var_ref.rb +0 -19
- data/lib/masamune/abstract_syntax_tree/nodes/vcall.rb +0 -17
@@ -1,17 +0,0 @@
|
|
1
|
-
# TODO: Add description.
|
2
|
-
|
3
|
-
module Masamune
|
4
|
-
class AbstractSyntaxTree
|
5
|
-
class VarField < Node
|
6
|
-
def initialize(contents, ast_id)
|
7
|
-
super
|
8
|
-
end
|
9
|
-
|
10
|
-
def extract_data_nodes
|
11
|
-
[
|
12
|
-
DataNode.new(@contents[1], @ast_id, self)
|
13
|
-
]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# TODO: Add description.
|
2
|
-
|
3
|
-
module Masamune
|
4
|
-
class AbstractSyntaxTree
|
5
|
-
class VarRef < Node
|
6
|
-
attr_accessor :ast_id
|
7
|
-
|
8
|
-
def initialize(contents, ast_id)
|
9
|
-
super
|
10
|
-
end
|
11
|
-
|
12
|
-
def extract_data_nodes
|
13
|
-
[
|
14
|
-
DataNode.new(@contents[1], @ast_id, self)
|
15
|
-
]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# TODO: Add description.
|
2
|
-
|
3
|
-
module Masamune
|
4
|
-
class AbstractSyntaxTree
|
5
|
-
class Vcall < Node
|
6
|
-
def initialize(contents, ast_id)
|
7
|
-
super
|
8
|
-
end
|
9
|
-
|
10
|
-
def extract_data_nodes
|
11
|
-
[
|
12
|
-
DataNode.new(@contents[1], @ast_id, self)
|
13
|
-
]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|