prism 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/docs/releasing.md +4 -1
- data/ext/prism/extension.c +3 -0
- data/ext/prism/extension.h +1 -1
- data/include/prism/version.h +2 -2
- data/lib/prism/serialize.rb +1 -1
- data/prism.gemspec +1 -1
- data/rbi/prism.rbi +5536 -5540
- data/rbi/prism_static.rbi +138 -142
- metadata +1 -1
data/rbi/prism_static.rbi
CHANGED
@@ -1,196 +1,192 @@
|
|
1
|
-
|
1
|
+
class Prism::ParseResult
|
2
|
+
sig { returns(Prism::ProgramNode) }
|
3
|
+
def value; end
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
sig { returns(ProgramNode) }
|
6
|
-
def value; end
|
5
|
+
sig { returns(T::Array[Prism::Comment]) }
|
6
|
+
def comments; end
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
sig { returns(T::Array[Prism::ParseError]) }
|
9
|
+
def errors; end
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
sig { returns(T::Array[Prism::ParseWarning]) }
|
12
|
+
def warnings; end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
sig { returns(Source) }
|
18
|
-
def source; end
|
19
|
-
end
|
14
|
+
sig { returns(Prism::Source) }
|
15
|
+
def source; end
|
16
|
+
end
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
class Prism::ParseError
|
19
|
+
sig { returns(String) }
|
20
|
+
def message; end
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
sig { returns(Prism::Location) }
|
23
|
+
def location; end
|
24
|
+
end
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
class Prism::ParseWarning
|
27
|
+
sig { returns(String) }
|
28
|
+
def message; end
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
sig { returns(Prism::Location) }
|
31
|
+
def location; end
|
32
|
+
end
|
36
33
|
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
class Prism::Node
|
35
|
+
sig { returns(T::Array[T.nilable(Prism::Node)]) }
|
36
|
+
def child_nodes; end
|
40
37
|
|
41
|
-
|
42
|
-
|
38
|
+
sig { returns(Prism::Location) }
|
39
|
+
def location; end
|
43
40
|
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
sig { returns(String) }
|
42
|
+
def slice; end
|
43
|
+
end
|
47
44
|
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
class Prism::Comment
|
46
|
+
sig { returns(Prism::Location) }
|
47
|
+
def location; end
|
51
48
|
|
52
|
-
|
53
|
-
|
54
|
-
|
49
|
+
sig { returns(T::Boolean) }
|
50
|
+
def trailing?; end
|
51
|
+
end
|
55
52
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
class Prism::InlineComment < Prism::Comment
|
54
|
+
sig { override.returns(T::Boolean) }
|
55
|
+
def trailing?; end
|
56
|
+
end
|
60
57
|
|
61
|
-
|
62
|
-
|
58
|
+
class Prism::EmbDocComment < Prism::Comment
|
59
|
+
end
|
63
60
|
|
64
|
-
|
65
|
-
|
61
|
+
class Prism::DATAComment < Prism::Comment
|
62
|
+
end
|
66
63
|
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
class Prism::Location
|
65
|
+
sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void }
|
66
|
+
def initialize(source, start_offset, length); end
|
70
67
|
|
71
|
-
|
72
|
-
|
68
|
+
sig { returns(String) }
|
69
|
+
def slice; end
|
73
70
|
|
74
|
-
|
75
|
-
|
71
|
+
sig { returns(T::Array[Prism::Comment]) }
|
72
|
+
def comments; end
|
76
73
|
|
77
|
-
|
78
|
-
|
74
|
+
sig { params(options: T.untyped).returns(Prism::Location) }
|
75
|
+
def copy(**options); end
|
79
76
|
|
80
|
-
|
81
|
-
|
77
|
+
sig { returns(Integer) }
|
78
|
+
def start_offset; end
|
82
79
|
|
83
|
-
|
84
|
-
|
80
|
+
sig { returns(Integer) }
|
81
|
+
def end_offset; end
|
85
82
|
|
86
|
-
|
87
|
-
|
83
|
+
sig { returns(Integer) }
|
84
|
+
def start_line; end
|
88
85
|
|
89
|
-
|
90
|
-
|
86
|
+
sig { returns(Integer) }
|
87
|
+
def end_line; end
|
91
88
|
|
92
|
-
|
93
|
-
|
89
|
+
sig { returns(Integer) }
|
90
|
+
def start_column; end
|
94
91
|
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
sig { returns(Integer) }
|
93
|
+
def end_column; end
|
94
|
+
end
|
98
95
|
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
class Prism::Source
|
97
|
+
sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void }
|
98
|
+
def initialize(source, start_line, offsets); end
|
102
99
|
|
103
|
-
|
104
|
-
|
100
|
+
sig { params(offset: Integer, length: Integer).returns(String) }
|
101
|
+
def slice(offset, length); end
|
105
102
|
|
106
|
-
|
107
|
-
|
103
|
+
sig { params(value: Integer).returns(Integer) }
|
104
|
+
def line(value); end
|
108
105
|
|
109
|
-
|
110
|
-
|
106
|
+
sig { params(value: Integer).returns(Integer) }
|
107
|
+
def line_offset(value); end
|
111
108
|
|
112
|
-
|
113
|
-
|
109
|
+
sig { params(value: Integer).returns(Integer) }
|
110
|
+
def column(value); end
|
114
111
|
|
115
|
-
|
116
|
-
|
112
|
+
sig { returns(String) }
|
113
|
+
def source; end
|
117
114
|
|
118
|
-
|
119
|
-
|
120
|
-
|
115
|
+
sig { returns(T::Array[Integer]) }
|
116
|
+
def offsets; end
|
117
|
+
end
|
121
118
|
|
122
|
-
|
123
|
-
|
124
|
-
|
119
|
+
class Prism::Token
|
120
|
+
sig { params(type: T.untyped, value: String, location: Prism::Location).void }
|
121
|
+
def initialize(type, value, location); end
|
125
122
|
|
126
|
-
|
127
|
-
|
123
|
+
sig { params(keys: T.untyped).returns(T.untyped) }
|
124
|
+
def deconstruct_keys(keys); end
|
128
125
|
|
129
|
-
|
130
|
-
|
126
|
+
sig { params(q: T.untyped).returns(T.untyped) }
|
127
|
+
def pretty_print(q); end
|
131
128
|
|
132
|
-
|
133
|
-
|
129
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
130
|
+
def ==(other); end
|
134
131
|
|
135
|
-
|
136
|
-
|
132
|
+
sig { returns(T.untyped) }
|
133
|
+
def type; end
|
137
134
|
|
138
|
-
|
139
|
-
|
135
|
+
sig { returns(String) }
|
136
|
+
def value; end
|
140
137
|
|
141
|
-
|
142
|
-
|
143
|
-
|
138
|
+
sig { returns(Prism::Location) }
|
139
|
+
def location; end
|
140
|
+
end
|
144
141
|
|
145
|
-
|
146
|
-
|
147
|
-
|
142
|
+
class Prism::NodeInspector
|
143
|
+
sig { params(prefix: String).void }
|
144
|
+
def initialize(prefix); end
|
148
145
|
|
149
|
-
|
150
|
-
|
146
|
+
sig { returns(String) }
|
147
|
+
def prefix; end
|
151
148
|
|
152
|
-
|
153
|
-
|
149
|
+
sig { returns(String) }
|
150
|
+
def output; end
|
154
151
|
|
155
|
-
|
156
|
-
|
157
|
-
|
152
|
+
# Appends a line to the output with the current prefix.
|
153
|
+
sig { params(line: String).void }
|
154
|
+
def <<(line); end
|
158
155
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
156
|
+
# This generates a string that is used as the header of the inspect output
|
157
|
+
# for any given node.
|
158
|
+
sig { params(node: Prism::Node).returns(String) }
|
159
|
+
def header(node); end
|
163
160
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
161
|
+
# Generates a string that represents a list of nodes. It handles properly
|
162
|
+
# using the box drawing characters to make the output look nice.
|
163
|
+
sig { params(prefix: String, nodes: T::Array[Prism::Node]).returns(String) }
|
164
|
+
def list(prefix, nodes); end
|
168
165
|
|
169
|
-
|
170
|
-
|
171
|
-
|
166
|
+
# Generates a string that represents a location field on a node.
|
167
|
+
sig { params(value: Prism::Location).returns(String) }
|
168
|
+
def location(value); end
|
172
169
|
|
173
|
-
|
174
|
-
|
175
|
-
|
170
|
+
# Generates a string that represents a child node.
|
171
|
+
sig { params(node: Prism::Node, append: String).returns(String) }
|
172
|
+
def child_node(node, append); end
|
176
173
|
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
# Returns a new inspector that can be used to inspect a child node.
|
175
|
+
sig { params(append: String).returns(Prism::NodeInspector) }
|
176
|
+
def child_inspector(append); end
|
180
177
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
178
|
+
# Returns the output as a string.
|
179
|
+
sig { returns(String) }
|
180
|
+
def to_str; end
|
181
|
+
end
|
185
182
|
|
186
|
-
|
187
|
-
|
188
|
-
|
183
|
+
class Prism::BasicVisitor
|
184
|
+
sig { params(node: T.nilable(Prism::Node)).void }
|
185
|
+
def visit(node); end
|
189
186
|
|
190
|
-
|
191
|
-
|
187
|
+
sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void }
|
188
|
+
def visit_all(nodes); end
|
192
189
|
|
193
|
-
|
194
|
-
|
195
|
-
end
|
190
|
+
sig { params(node: Prism::Node).void }
|
191
|
+
def visit_child_nodes(node); end
|
196
192
|
end
|