ruby_mod_kit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +99 -0
  4. data/examples/user.rb +83 -0
  5. data/examples/user.rbm +47 -0
  6. data/exe/ruby_mod_kit +5 -0
  7. data/lib/ruby_mod_kit/cli.rb +27 -0
  8. data/lib/ruby_mod_kit/generation.rb +170 -0
  9. data/lib/ruby_mod_kit/memo/class.rb +27 -0
  10. data/lib/ruby_mod_kit/memo/ivar.rb +42 -0
  11. data/lib/ruby_mod_kit/memo/method.rb +49 -0
  12. data/lib/ruby_mod_kit/memo/offset_memo.rb +26 -0
  13. data/lib/ruby_mod_kit/memo/parameter.rb +39 -0
  14. data/lib/ruby_mod_kit/memo.rb +73 -0
  15. data/lib/ruby_mod_kit/mission/fix_parse_error.rb +213 -0
  16. data/lib/ruby_mod_kit/mission/ivar_arg.rb +42 -0
  17. data/lib/ruby_mod_kit/mission/overload.rb +73 -0
  18. data/lib/ruby_mod_kit/mission/type_attr.rb +75 -0
  19. data/lib/ruby_mod_kit/mission/type_parameter.rb +39 -0
  20. data/lib/ruby_mod_kit/mission/type_return.rb +33 -0
  21. data/lib/ruby_mod_kit/mission.rb +40 -0
  22. data/lib/ruby_mod_kit/node/call_node.rb +30 -0
  23. data/lib/ruby_mod_kit/node/class_node.rb +37 -0
  24. data/lib/ruby_mod_kit/node/def_node.rb +57 -0
  25. data/lib/ruby_mod_kit/node/parameter_node.rb +42 -0
  26. data/lib/ruby_mod_kit/node/program_node.rb +23 -0
  27. data/lib/ruby_mod_kit/node/statements_node.rb +27 -0
  28. data/lib/ruby_mod_kit/node/symbol_node.rb +34 -0
  29. data/lib/ruby_mod_kit/node/untyped_node.rb +25 -0
  30. data/lib/ruby_mod_kit/node.rb +164 -0
  31. data/lib/ruby_mod_kit/offset_diff.rb +37 -0
  32. data/lib/ruby_mod_kit/transpiler.rb +20 -0
  33. data/lib/ruby_mod_kit/version.rb +7 -0
  34. data/lib/ruby_mod_kit.rb +59 -0
  35. data/ruby_mod_kit.gemspec +51 -0
  36. data/sig/generated/examples/user.rbs +60 -0
  37. data/sig/generated/ruby_mod_kit/cli.rbs +14 -0
  38. data/sig/generated/ruby_mod_kit/generation.rbs +101 -0
  39. data/sig/generated/ruby_mod_kit/memo/class.rbs +20 -0
  40. data/sig/generated/ruby_mod_kit/memo/ivar.rbs +30 -0
  41. data/sig/generated/ruby_mod_kit/memo/located.rbs +14 -0
  42. data/sig/generated/ruby_mod_kit/memo/method.rbs +37 -0
  43. data/sig/generated/ruby_mod_kit/memo/offset_memo.rbs +20 -0
  44. data/sig/generated/ruby_mod_kit/memo/parameter.rbs +33 -0
  45. data/sig/generated/ruby_mod_kit/memo/parameter_type.rbs +14 -0
  46. data/sig/generated/ruby_mod_kit/memo.rbs +41 -0
  47. data/sig/generated/ruby_mod_kit/mission/fix_parse_error.rbs +73 -0
  48. data/sig/generated/ruby_mod_kit/mission/ivar_arg.rbs +19 -0
  49. data/sig/generated/ruby_mod_kit/mission/overload.rbs +20 -0
  50. data/sig/generated/ruby_mod_kit/mission/type_attr.rbs +18 -0
  51. data/sig/generated/ruby_mod_kit/mission/type_parameter.rbs +18 -0
  52. data/sig/generated/ruby_mod_kit/mission/type_return.rbs +18 -0
  53. data/sig/generated/ruby_mod_kit/mission.rbs +25 -0
  54. data/sig/generated/ruby_mod_kit/node/call_node.rbs +25 -0
  55. data/sig/generated/ruby_mod_kit/node/class_node.rbs +29 -0
  56. data/sig/generated/ruby_mod_kit/node/def_node.rbs +39 -0
  57. data/sig/generated/ruby_mod_kit/node/parameter_node.rbs +26 -0
  58. data/sig/generated/ruby_mod_kit/node/program_node.rbs +16 -0
  59. data/sig/generated/ruby_mod_kit/node/statements_node.rbs +21 -0
  60. data/sig/generated/ruby_mod_kit/node/symbol_node.rbs +24 -0
  61. data/sig/generated/ruby_mod_kit/node/untyped_node.rbs +21 -0
  62. data/sig/generated/ruby_mod_kit/node.rbs +63 -0
  63. data/sig/generated/ruby_mod_kit/offset_diff.rbs +20 -0
  64. data/sig/generated/ruby_mod_kit/transpiler.rbs +11 -0
  65. data/sig/generated/ruby_mod_kit/version.rbs +5 -0
  66. data/sig/generated/ruby_mod_kit.rbs +33 -0
  67. data/sig/sorted_set.rbs +8 -0
  68. data/sig/thor.rbs +3 -0
  69. metadata +157 -0
@@ -0,0 +1,101 @@
1
+ # Generated from lib/ruby_mod_kit/generation.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ # The class of transpiler generation.
5
+ class Generation
6
+ @parse_result: Prism::ParseResult
7
+
8
+ @script: String
9
+
10
+ @missions: Array[Mission]
11
+
12
+ @memo: Memo
13
+
14
+ @root_node: Node::ProgramNode
15
+
16
+ @offset_diff: OffsetDiff
17
+
18
+ @generation_num: Integer
19
+
20
+ @filename: String | nil
21
+
22
+ attr_reader parse_result: Prism::ParseResult
23
+
24
+ attr_reader script: String
25
+
26
+ # @rbs script: String
27
+ # @rbs missions: Array[Mission]
28
+ # @rbs memo: Memo
29
+ # @rbs generation_num: Integer
30
+ # @rbs filename: String | nil
31
+ # @rbs return: void
32
+ def initialize: (String script, ?missions: Array[Mission], ?memo: Memo, ?generation_num: Integer, ?filename: String | nil) -> void
33
+
34
+ # @rbs return: void
35
+ def init_missions: () -> void
36
+
37
+ # @rbs return: bool
38
+ def first_generation?: () -> bool
39
+
40
+ # @rbs return: Generation
41
+ def succ: () -> Generation
42
+
43
+ # @rbs return: String
44
+ def name: () -> String
45
+
46
+ # @rbs return: void
47
+ def resolve: () -> void
48
+
49
+ # @rbs return: bool
50
+ def completed?: () -> bool
51
+
52
+ # @rbs src_offset: Integer
53
+ # @rbs length: Integer
54
+ # @rbs str: String
55
+ # @rbs return: String
56
+ def []=: (Integer src_offset, Integer length, String str) -> String
57
+
58
+ # @rbs src_range: Range[Integer]
59
+ # @rbs return: String
60
+ def []: (Range[Integer] src_range) -> String
61
+
62
+ # @rbs (Integer) -> String
63
+ # | (Node) -> String
64
+ # | (Prism::ParseError) -> String
65
+ def line: (Integer) -> String
66
+ | (Node) -> String
67
+ | (Prism::ParseError) -> String
68
+
69
+ # @rbs line_num: Integer
70
+ # @rbs return: String
71
+ def line__overload0: (Integer line_num) -> String
72
+
73
+ # @rbs node: Node
74
+ # @rbs return: String
75
+ def line__overload1: (Node node) -> String
76
+
77
+ # @rbs parse_error: Prism::ParseError
78
+ # @rbs return: String
79
+ def line__overload2: (Prism::ParseError parse_error) -> String
80
+
81
+ # @rbs (Integer) -> (Integer | nil)
82
+ # | (Prism::ParseError) -> (Integer | nil)
83
+ def src_offset: (Integer) -> (Integer | nil)
84
+ | (Prism::ParseError) -> (Integer | nil)
85
+
86
+ # @rbs line_num: Integer
87
+ # @rbs return: Integer | nil
88
+ def src_offset__overload0: (Integer line_num) -> (Integer | nil)
89
+
90
+ # @rbs parse_error: Prism::ParseError
91
+ # @rbs return: Integer | nil
92
+ def src_offset__overload1: (Prism::ParseError parse_error) -> (Integer | nil)
93
+
94
+ # @rbs return: void
95
+ def perform_missions: () -> void
96
+
97
+ # @rbs mission: Mission
98
+ # @rbs return: void
99
+ def add_mission: (Mission mission) -> void
100
+ end
101
+ end
@@ -0,0 +1,20 @@
1
+ # Generated from lib/ruby_mod_kit/memo/class.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The memo for parameter type
6
+ class Class < OffsetMemo
7
+ @ivars_memo: Hash[Symbol, Memo::Ivar]
8
+
9
+ attr_reader ivars_memo: Hash[Symbol, Memo::Ivar]
10
+
11
+ # @rbs class_node: Node::ClassNode
12
+ # @rbs return: void
13
+ def initialize: (Node::ClassNode class_node) -> void
14
+
15
+ # @rbs name: Symbol
16
+ # @rbs return: Memo::Ivar
17
+ def ivar_memo: (Symbol name) -> Memo::Ivar
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,30 @@
1
+ # Generated from lib/ruby_mod_kit/memo/ivar.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The memo for parameter type
6
+ class Ivar
7
+ @type: nil | String
8
+
9
+ @attr_kind: nil | Symbol
10
+
11
+ @name: Symbol
12
+
13
+ attr_reader type: nil | String
14
+
15
+ attr_reader attr_kind: nil | Symbol
16
+
17
+ # @rbs name: Symbol
18
+ # @rbs return: void
19
+ def initialize: (Symbol name) -> void
20
+
21
+ # @rbs type: String
22
+ # @rbs return: void
23
+ def type=: (String type) -> void
24
+
25
+ # @rbs kind: Symbol | String
26
+ # @rbs return: void
27
+ def attr_kind=: (Symbol | String kind) -> void
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,14 @@
1
+ # Generated from lib/ruby_mod_kit/memo/located.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The base class for located memo
6
+ class Located
7
+ attr_reader offset: Integer
8
+
9
+ # @rbs offset: Integer
10
+ # @rbs return: void
11
+ def initialize: (Integer offset) -> void
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,37 @@
1
+ # Generated from lib/ruby_mod_kit/memo/method.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The memo for parameter type
6
+ class Method < OffsetMemo
7
+ @name: Symbol
8
+
9
+ @parameters: Set[Memo::Parameter]
10
+
11
+ @type: String
12
+
13
+ attr_reader name: Symbol
14
+
15
+ attr_reader parameters: Set[Memo::Parameter]
16
+
17
+ attr_reader type: String
18
+
19
+ UNTYPED: ::String
20
+
21
+ # @rbs node: Node::DefNode
22
+ # @rbs return: void
23
+ def initialize: (Node::DefNode node) -> void
24
+
25
+ # @rbs parameter_memo: Memo::Parameter
26
+ # @rbs return: Memo::Parameter
27
+ def add_parameter: (Memo::Parameter parameter_memo) -> Memo::Parameter
28
+
29
+ # @rbs return: bool
30
+ def untyped?: () -> bool
31
+
32
+ # @rbs type: String
33
+ # @rbs return: void
34
+ def type=: (String type) -> void
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,20 @@
1
+ # Generated from lib/ruby_mod_kit/memo/offset_memo.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The base class for located memo
6
+ class OffsetMemo
7
+ @offset: Integer
8
+
9
+ attr_reader offset: Integer
10
+
11
+ # @rbs offset: Integer
12
+ # @rbs return: void
13
+ def initialize: (Integer offset) -> void
14
+
15
+ # @rbs offset_diff: OffsetDiff
16
+ # @rbs return: void
17
+ def succ: (OffsetDiff offset_diff) -> void
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ # Generated from lib/ruby_mod_kit/memo/parameter.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The memo for parameter type
6
+ class Parameter < OffsetMemo
7
+ @type: String
8
+
9
+ @ivar_parameter: bool
10
+
11
+ @qualifier: String
12
+
13
+ attr_reader type: String
14
+
15
+ attr_accessor ivar_parameter: bool
16
+
17
+ attr_accessor qualifier: String
18
+
19
+ UNTYPED: ::String
20
+
21
+ # @rbs offset: Integer
22
+ # @rbs return: void
23
+ def initialize: (Integer offset) -> void
24
+
25
+ # @rbs return: bool
26
+ def untyped?: () -> bool
27
+
28
+ # @rbs type: String
29
+ # @rbs return: void
30
+ def type=: (String type) -> void
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,14 @@
1
+ # Generated from lib/ruby_mod_kit/memo/parameter_type.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Memo
5
+ # The memo for parameter type
6
+ class ParameterType < Located
7
+ # @rbs offset: Integer
8
+ # @rbs name: Symbol
9
+ # @rbs type: String
10
+ # @rbs return: void
11
+ def initialize: (Integer offset, Symbol name, String type) -> void
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,41 @@
1
+ # Generated from lib/ruby_mod_kit/memo.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ # The class of transpiler generation.
5
+ class Memo
6
+ @classes_memo: Hash[Integer, Memo::Class]
7
+
8
+ @methods_memo: Hash[Integer, Memo::Method]
9
+
10
+ @parameters_memo: Hash[Integer, Memo::Parameter]
11
+
12
+ attr_reader classes_memo: Hash[Integer, Memo::Class]
13
+
14
+ attr_reader methods_memo: Hash[Integer, Memo::Method]
15
+
16
+ attr_reader parameters_memo: Hash[Integer, Memo::Parameter]
17
+
18
+ # @rbs return: void
19
+ def initialize: () -> void
20
+
21
+ # @rbs offset_diff: OffsetDiff
22
+ # @rbs return: void
23
+ def succ: (OffsetDiff offset_diff) -> void
24
+
25
+ # @rbs class_node: Node::ClassNode
26
+ # @rbs return: Memo::Class
27
+ def class_memo: (Node::ClassNode class_node) -> Memo::Class
28
+
29
+ # @rbs def_node: Node::DefNode
30
+ # @rbs return: Memo::Method
31
+ def method_memo: (Node::DefNode def_node) -> Memo::Method
32
+
33
+ # @rbs node: Node
34
+ # @rbs return: Memo::Parameter
35
+ def parameter_memo: (Node node) -> Memo::Parameter
36
+
37
+ # @rbs type: String
38
+ # @rbs return: String
39
+ def self.unify_type: (String type) -> String
40
+ end
41
+ end
@@ -0,0 +1,73 @@
1
+ # Generated from lib/ruby_mod_kit/mission/fix_parse_error.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for parameter types
6
+ class FixParseError < Mission
7
+ @previous_error_messages: Array[String]
8
+
9
+ # @rbs return: void
10
+ def initialize: () -> void
11
+
12
+ # @rbs generation: Generation
13
+ # @rbs root_node: Node
14
+ # @rbs parse_result: Prism::ParseResult
15
+ # @rbs memo: Memo
16
+ # @rbs return: bool
17
+ def perform: (Generation generation, Node root_node, Prism::ParseResult parse_result, Memo memo) -> bool
18
+
19
+ # @rbs generation: Generation
20
+ # @rbs parse_result: Prism::ParseResult
21
+ # @rbs return: void
22
+ def check_prev_errors: (Generation generation, Prism::ParseResult parse_result) -> void
23
+
24
+ # @rbs parse_error: Prism::ParseError
25
+ # @rbs generation: Generation
26
+ # @rbs root_node: Node
27
+ # @rbs memo: Memo
28
+ # @rbs return: void
29
+ def fix_def_params_term_paren: (Prism::ParseError parse_error, Generation generation, Node root_node, Memo memo) -> void
30
+
31
+ # @rbs parse_error: Prism::ParseError
32
+ # @rbs generation: Generation
33
+ # @rbs root_node: Node
34
+ # @rbs memo: Memo
35
+ # @rbs return: void
36
+ def fix_argument_formal_ivar: (Prism::ParseError parse_error, Generation generation, Node root_node, Memo memo) -> void
37
+
38
+ # @rbs parse_error: Prism::ParseError
39
+ # @rbs generation: Generation
40
+ # @rbs return: void
41
+ def fix_argument_formal_constant: (Prism::ParseError parse_error, Generation generation) -> void
42
+
43
+ # @rbs parse_error: Prism::ParseError
44
+ # @rbs generation: Generation
45
+ # @rbs root_node: Node
46
+ # @rbs memo: Memo
47
+ # @rbs return: void
48
+ def fix_unexpected_assoc: (Prism::ParseError parse_error, Generation generation, Node root_node, Memo memo) -> void
49
+
50
+ # @rbs parse_error: Prism::ParseError
51
+ # @rbs generation: Generation
52
+ # @rbs root_node: Node
53
+ # @rbs memo: Memo
54
+ # @rbs return: void
55
+ def fix_unexpected_colon: (Prism::ParseError parse_error, Generation generation, Node root_node, Memo memo) -> void
56
+
57
+ # @rbs parse_error: Prism::ParseError
58
+ # @rbs generation: Generation
59
+ # @rbs root_node: Node
60
+ # @rbs def_node: Node::DefNode
61
+ # @rbs memo: Memo
62
+ # @rbs return: void
63
+ def fix_unexpected_colon_in_def: (Prism::ParseError parse_error, Generation generation, Node root_node, Node::DefNode def_node, Memo memo) -> void
64
+
65
+ # @rbs parse_error: Prism::ParseError
66
+ # @rbs generation: Generation
67
+ # @rbs class_node: Node::ClassNode
68
+ # @rbs memo: Memo
69
+ # @rbs return: void
70
+ def fix_unexpected_colon_in_module: (Prism::ParseError parse_error, Generation generation, Node::ClassNode class_node, Memo memo) -> void
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,19 @@
1
+ # Generated from lib/ruby_mod_kit/mission/ivar_arg.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for instance variable arguments
6
+ class IvarArg < Mission
7
+ @assignment: String
8
+
9
+ attr_reader assignment: String
10
+
11
+ # @rbs generation: Generation
12
+ # @rbs root_node: Node
13
+ # @rbs _parse_result: Prism::ParseResult
14
+ # @rbs _memo: Memo
15
+ # @rbs return: bool
16
+ def perform: (Generation generation, Node root_node, untyped _parse_result, untyped _memo) -> bool
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ # Generated from lib/ruby_mod_kit/mission/overload.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for overload
6
+ class Overload < Mission
7
+ OVERLOAD_METHOD_MAP: Hash[Symbol, String]
8
+
9
+ # @rbs return: void
10
+ def initialize: () -> void
11
+
12
+ # @rbs generation: Generation
13
+ # @rbs root_node: Node
14
+ # @rbs parse_result: Prism::ParseResult
15
+ # @rbs memo: Memo
16
+ # @rbs return: bool
17
+ def perform: (Generation generation, Node root_node, Prism::ParseResult parse_result, Memo memo) -> bool
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # Generated from lib/ruby_mod_kit/mission/type_attr.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for parameter types
6
+ class TypeAttr < Mission
7
+ # @rbs return: void
8
+ def initialize: () -> void
9
+
10
+ # @rbs generation: Generation
11
+ # @rbs root_node: Node
12
+ # @rbs _parse_result: Prism::ParseResult
13
+ # @rbs memo: Memo
14
+ # @rbs return: bool
15
+ def perform: (Generation generation, Node root_node, untyped _parse_result, Memo memo) -> bool
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # Generated from lib/ruby_mod_kit/mission/type_parameter.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for parameter types
6
+ class TypeParameter < Mission
7
+ # @rbs return: void
8
+ def initialize: () -> void
9
+
10
+ # @rbs generation: Generation
11
+ # @rbs root_node: Node
12
+ # @rbs parse_result: Prism::ParseResult
13
+ # @rbs memo: Memo
14
+ # @rbs return: bool
15
+ def perform: (Generation generation, Node root_node, Prism::ParseResult parse_result, Memo memo) -> bool
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # Generated from lib/ruby_mod_kit/mission/type_return.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Mission
5
+ # The mission for parameter types
6
+ class TypeReturn < Mission
7
+ # @rbs return: void
8
+ def initialize: () -> void
9
+
10
+ # @rbs generation: Generation
11
+ # @rbs root_node: Node
12
+ # @rbs parse_result: Prism::ParseResult
13
+ # @rbs memo: Memo
14
+ # @rbs return: bool
15
+ def perform: (Generation generation, Node root_node, Prism::ParseResult parse_result, Memo memo) -> bool
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ # Generated from lib/ruby_mod_kit/mission.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ # The class of transpiler mission.
5
+ class Mission
6
+ @offset: Integer
7
+
8
+ attr_accessor offset: Integer
9
+
10
+ # @rbs offset: Integer
11
+ # @rbs return: void
12
+ def initialize: (Integer offset) -> void
13
+
14
+ # @rbs _generation: Generation
15
+ # @rbs _root_node: Node
16
+ # @rbs _parse_result: Prism::ParseResult
17
+ # @rbs _memo: Memo
18
+ # @rbs return: void
19
+ def perform: (untyped _generation, untyped _root_node, untyped _parse_result, untyped _memo) -> void
20
+
21
+ # @rbs offset_diff: OffsetDiff
22
+ # @rbs return: void
23
+ def succ: (OffsetDiff offset_diff) -> void
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # Generated from lib/ruby_mod_kit/node/call_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler method call node
6
+ class CallNode < Node
7
+ @prism_node: Prism::CallNode
8
+
9
+ @name: Symbol
10
+
11
+ @parent: Node
12
+
13
+ attr_reader prism_node: Prism::CallNode
14
+
15
+ attr_reader name: Symbol
16
+
17
+ attr_reader parent: Node
18
+
19
+ # @rbs prism_node: Prism::CallNode
20
+ # @rbs parent: Node
21
+ # @rbs return: void
22
+ def initialize: (Prism::CallNode prism_node, parent: Node) -> void
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ # Generated from lib/ruby_mod_kit/node/class_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler program node
6
+ class ClassNode < Node
7
+ @prism_node: Prism::ClassNode
8
+
9
+ @body_node: nil | Node::StatementsNode
10
+
11
+ @parent: Node
12
+
13
+ attr_reader prism_node: Prism::ClassNode
14
+
15
+ attr_reader body_node: nil | Node::StatementsNode
16
+
17
+ attr_reader parent: Node
18
+
19
+ # @rbs prism_node: Prism::ClassNode
20
+ # @rbs parent: Node
21
+ # @rbs return: void
22
+ def initialize: (Prism::ClassNode prism_node, parent: Node) -> void
23
+
24
+ # @rbs child_prism_node: Prism::Node
25
+ # @rbs return: Node
26
+ def wrap: (Prism::Node child_prism_node) -> Node
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,39 @@
1
+ # Generated from lib/ruby_mod_kit/node/def_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler program node
6
+ class DefNode < Node
7
+ @prism_node: Prism::DefNode
8
+
9
+ @parent: Node
10
+
11
+ attr_reader prism_node: Prism::DefNode
12
+
13
+ attr_reader parent: Node
14
+
15
+ # @rbs prism_node: Prism::DefNode
16
+ # @rbs parent: Node
17
+ # @rbs return: void
18
+ def initialize: (Prism::DefNode prism_node, parent: Node) -> void
19
+
20
+ # @rbs return: Symbol
21
+ def name: () -> Symbol
22
+
23
+ # @rbs return: Prism::Location | nil
24
+ def body_location: () -> (Prism::Location | nil)
25
+
26
+ # @rbs return: Prism::Location | nil
27
+ def lparen_loc: () -> (Prism::Location | nil)
28
+
29
+ # @rbs return: Prism::Location | nil
30
+ def rparen_loc: () -> (Prism::Location | nil)
31
+
32
+ # @rbs return: Prism::Location
33
+ def name_loc: () -> Prism::Location
34
+
35
+ # @rbs return: Prism::Location | nil
36
+ def end_keyword_loc: () -> (Prism::Location | nil)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,26 @@
1
+ # Generated from lib/ruby_mod_kit/node/parameter_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler program node
6
+ class ParameterNode < Node
7
+ type prism_node = Prism::RequiredParameterNode | Prism::OptionalKeywordParameterNode | Prism::OptionalParameterNode | Prism::RequiredKeywordParameterNode | Prism::RestParameterNode
8
+
9
+ @prism_node: prism_node
10
+
11
+ @parent: Node
12
+
13
+ attr_reader prism_node: prism_node
14
+
15
+ attr_reader parent: Node
16
+
17
+ # @rbs prism_node: prism_node
18
+ # @rbs parent: Node
19
+ # @rbs return: void
20
+ def initialize: (prism_node prism_node, parent: Node) -> void
21
+
22
+ # @rbs return: Symbol | nil
23
+ def name: () -> (Symbol | nil)
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ # Generated from lib/ruby_mod_kit/node/program_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler program node
6
+ class ProgramNode < Node
7
+ @prism_node: Prism::ProgramNode
8
+
9
+ attr_reader prism_node: Prism::ProgramNode
10
+
11
+ # @rbs prism_node: Prism::ProgramNode
12
+ # @rbs return: void
13
+ def initialize: (Prism::ProgramNode prism_node) -> void
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # Generated from lib/ruby_mod_kit/node/statements_node.rb with RBS::Inline
2
+
3
+ module RubyModKit
4
+ class Node
5
+ # Transpiler program node
6
+ class StatementsNode < Node
7
+ @prism_node: Prism::StatementsNode
8
+
9
+ @parent: Node
10
+
11
+ attr_reader prism_node: Prism::StatementsNode
12
+
13
+ attr_reader parent: Node
14
+
15
+ # @rbs prism_node: Prism::StatementsNode
16
+ # @rbs parent: Node
17
+ # @rbs return: void
18
+ def initialize: (Prism::StatementsNode prism_node, parent: Node) -> void
19
+ end
20
+ end
21
+ end