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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +4 -1
  4. data/README.md +30 -82
  5. data/lib/masamune/abstract_syntax_tree/prism/node_extensions.rb +82 -0
  6. data/lib/masamune/abstract_syntax_tree/visitors/block_parameters_visitor.rb +18 -0
  7. data/lib/masamune/abstract_syntax_tree/visitors/method_calls_visitor.rb +19 -0
  8. data/lib/masamune/abstract_syntax_tree/visitors/method_definitions_visitor.rb +17 -0
  9. data/lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb +18 -0
  10. data/lib/masamune/abstract_syntax_tree/visitors/strings_visitor.rb +17 -0
  11. data/lib/masamune/abstract_syntax_tree/visitors/symbols_visitor.rb +17 -0
  12. data/lib/masamune/abstract_syntax_tree/visitors/variables_visitor.rb +34 -0
  13. data/lib/masamune/abstract_syntax_tree.rb +57 -134
  14. data/lib/masamune/lex_node.rb +6 -6
  15. data/lib/masamune/slasher.rb +9 -15
  16. data/lib/masamune/version.rb +1 -1
  17. data/lib/masamune.rb +10 -22
  18. metadata +29 -27
  19. data/lib/masamune/abstract_syntax_tree/data_node.rb +0 -49
  20. data/lib/masamune/abstract_syntax_tree/node.rb +0 -41
  21. data/lib/masamune/abstract_syntax_tree/nodes/assign.rb +0 -11
  22. data/lib/masamune/abstract_syntax_tree/nodes/blocks/brace_block.rb +0 -13
  23. data/lib/masamune/abstract_syntax_tree/nodes/blocks/do_block.rb +0 -13
  24. data/lib/masamune/abstract_syntax_tree/nodes/call.rb +0 -17
  25. data/lib/masamune/abstract_syntax_tree/nodes/command.rb +0 -64
  26. data/lib/masamune/abstract_syntax_tree/nodes/def.rb +0 -17
  27. data/lib/masamune/abstract_syntax_tree/nodes/params.rb +0 -23
  28. data/lib/masamune/abstract_syntax_tree/nodes/program.rb +0 -16
  29. data/lib/masamune/abstract_syntax_tree/nodes/string_content.rb +0 -17
  30. data/lib/masamune/abstract_syntax_tree/nodes/support_nodes/block.rb +0 -18
  31. data/lib/masamune/abstract_syntax_tree/nodes/support_nodes/comment.rb +0 -25
  32. data/lib/masamune/abstract_syntax_tree/nodes/symbol.rb +0 -17
  33. data/lib/masamune/abstract_syntax_tree/nodes/symbols/dyna_symbol.rb +0 -20
  34. data/lib/masamune/abstract_syntax_tree/nodes/symbols/symbol_literal.rb +0 -21
  35. data/lib/masamune/abstract_syntax_tree/nodes/variables/block_var.rb +0 -22
  36. data/lib/masamune/abstract_syntax_tree/nodes/variables/var_field.rb +0 -17
  37. data/lib/masamune/abstract_syntax_tree/nodes/variables/var_ref.rb +0 -19
  38. 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