jruby-prism-parser 0.23.0.pre.SNAPSHOT-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +401 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +62 -0
- data/LICENSE.md +7 -0
- data/Makefile +101 -0
- data/README.md +98 -0
- data/config.yml +2902 -0
- data/docs/build_system.md +91 -0
- data/docs/configuration.md +64 -0
- data/docs/cruby_compilation.md +27 -0
- data/docs/design.md +53 -0
- data/docs/encoding.md +121 -0
- data/docs/fuzzing.md +88 -0
- data/docs/heredocs.md +36 -0
- data/docs/javascript.md +118 -0
- data/docs/local_variable_depth.md +229 -0
- data/docs/mapping.md +117 -0
- data/docs/parser_translation.md +34 -0
- data/docs/parsing_rules.md +19 -0
- data/docs/releasing.md +98 -0
- data/docs/ripper.md +36 -0
- data/docs/ruby_api.md +43 -0
- data/docs/ruby_parser_translation.md +19 -0
- data/docs/serialization.md +209 -0
- data/docs/testing.md +55 -0
- data/ext/prism/api_node.c +5098 -0
- data/ext/prism/api_pack.c +267 -0
- data/ext/prism/extconf.rb +110 -0
- data/ext/prism/extension.c +1155 -0
- data/ext/prism/extension.h +18 -0
- data/include/prism/ast.h +5807 -0
- data/include/prism/defines.h +102 -0
- data/include/prism/diagnostic.h +339 -0
- data/include/prism/encoding.h +265 -0
- data/include/prism/node.h +57 -0
- data/include/prism/options.h +230 -0
- data/include/prism/pack.h +152 -0
- data/include/prism/parser.h +732 -0
- data/include/prism/prettyprint.h +26 -0
- data/include/prism/regexp.h +33 -0
- data/include/prism/util/pm_buffer.h +155 -0
- data/include/prism/util/pm_char.h +205 -0
- data/include/prism/util/pm_constant_pool.h +209 -0
- data/include/prism/util/pm_list.h +97 -0
- data/include/prism/util/pm_memchr.h +29 -0
- data/include/prism/util/pm_newline_list.h +93 -0
- data/include/prism/util/pm_state_stack.h +42 -0
- data/include/prism/util/pm_string.h +150 -0
- data/include/prism/util/pm_string_list.h +44 -0
- data/include/prism/util/pm_strncasecmp.h +32 -0
- data/include/prism/util/pm_strpbrk.h +46 -0
- data/include/prism/version.h +29 -0
- data/include/prism.h +289 -0
- data/jruby-prism.jar +0 -0
- data/lib/prism/compiler.rb +486 -0
- data/lib/prism/debug.rb +206 -0
- data/lib/prism/desugar_compiler.rb +207 -0
- data/lib/prism/dispatcher.rb +2150 -0
- data/lib/prism/dot_visitor.rb +4634 -0
- data/lib/prism/dsl.rb +785 -0
- data/lib/prism/ffi.rb +346 -0
- data/lib/prism/lex_compat.rb +908 -0
- data/lib/prism/mutation_compiler.rb +753 -0
- data/lib/prism/node.rb +17864 -0
- data/lib/prism/node_ext.rb +212 -0
- data/lib/prism/node_inspector.rb +68 -0
- data/lib/prism/pack.rb +224 -0
- data/lib/prism/parse_result/comments.rb +177 -0
- data/lib/prism/parse_result/newlines.rb +64 -0
- data/lib/prism/parse_result.rb +498 -0
- data/lib/prism/pattern.rb +250 -0
- data/lib/prism/serialize.rb +1354 -0
- data/lib/prism/translation/parser/compiler.rb +1838 -0
- data/lib/prism/translation/parser/lexer.rb +335 -0
- data/lib/prism/translation/parser/rubocop.rb +37 -0
- data/lib/prism/translation/parser.rb +178 -0
- data/lib/prism/translation/ripper.rb +577 -0
- data/lib/prism/translation/ruby_parser.rb +1521 -0
- data/lib/prism/translation.rb +11 -0
- data/lib/prism/version.rb +3 -0
- data/lib/prism/visitor.rb +495 -0
- data/lib/prism.rb +99 -0
- data/prism.gemspec +135 -0
- data/rbi/prism.rbi +7767 -0
- data/rbi/prism_static.rbi +207 -0
- data/sig/prism.rbs +4773 -0
- data/sig/prism_static.rbs +201 -0
- data/src/diagnostic.c +400 -0
- data/src/encoding.c +5132 -0
- data/src/node.c +2786 -0
- data/src/options.c +213 -0
- data/src/pack.c +493 -0
- data/src/prettyprint.c +8881 -0
- data/src/prism.c +18406 -0
- data/src/regexp.c +638 -0
- data/src/serialize.c +1554 -0
- data/src/token_type.c +700 -0
- data/src/util/pm_buffer.c +190 -0
- data/src/util/pm_char.c +318 -0
- data/src/util/pm_constant_pool.c +322 -0
- data/src/util/pm_list.c +49 -0
- data/src/util/pm_memchr.c +35 -0
- data/src/util/pm_newline_list.c +84 -0
- data/src/util/pm_state_stack.c +25 -0
- data/src/util/pm_string.c +203 -0
- data/src/util/pm_string_list.c +28 -0
- data/src/util/pm_strncasecmp.c +24 -0
- data/src/util/pm_strpbrk.c +180 -0
- metadata +156 -0
@@ -0,0 +1,207 @@
|
|
1
|
+
class Prism::ParseResult
|
2
|
+
sig { returns(Prism::ProgramNode) }
|
3
|
+
def value; end
|
4
|
+
|
5
|
+
sig { returns(T::Array[Prism::Comment]) }
|
6
|
+
def comments; end
|
7
|
+
|
8
|
+
sig { returns(T::Array[Prism::ParseError]) }
|
9
|
+
def errors; end
|
10
|
+
|
11
|
+
sig { returns(T::Array[Prism::ParseWarning]) }
|
12
|
+
def warnings; end
|
13
|
+
|
14
|
+
sig { returns(Prism::Source) }
|
15
|
+
def source; end
|
16
|
+
end
|
17
|
+
|
18
|
+
class Prism::ParseError
|
19
|
+
sig { returns(String) }
|
20
|
+
def message; end
|
21
|
+
|
22
|
+
sig { returns(Prism::Location) }
|
23
|
+
def location; end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Prism::ParseWarning
|
27
|
+
sig { returns(String) }
|
28
|
+
def message; end
|
29
|
+
|
30
|
+
sig { returns(Prism::Location) }
|
31
|
+
def location; end
|
32
|
+
end
|
33
|
+
|
34
|
+
class Prism::Node
|
35
|
+
sig { returns(Prism::Location) }
|
36
|
+
def location; end
|
37
|
+
|
38
|
+
sig { returns(String) }
|
39
|
+
def slice; end
|
40
|
+
|
41
|
+
sig { returns(String) }
|
42
|
+
def to_dot; end
|
43
|
+
|
44
|
+
sig { params(visitor: Prism::Visitor).void }
|
45
|
+
def accept(visitor); end
|
46
|
+
|
47
|
+
sig { returns(T::Array[T.nilable(Prism::Node)]) }
|
48
|
+
def child_nodes; end
|
49
|
+
|
50
|
+
sig { returns(T::Array[Prism::Node]) }
|
51
|
+
def compact_child_nodes; end
|
52
|
+
|
53
|
+
sig { returns(T::Array[T.nilable(Prism::Node)]) }
|
54
|
+
def deconstruct; end
|
55
|
+
|
56
|
+
sig { returns(Symbol) }
|
57
|
+
def type; end
|
58
|
+
end
|
59
|
+
|
60
|
+
class Prism::Comment
|
61
|
+
sig { returns(Prism::Location) }
|
62
|
+
def location; end
|
63
|
+
|
64
|
+
sig { returns(T::Boolean) }
|
65
|
+
def trailing?; end
|
66
|
+
end
|
67
|
+
|
68
|
+
class Prism::InlineComment < Prism::Comment
|
69
|
+
sig { override.returns(T::Boolean) }
|
70
|
+
def trailing?; end
|
71
|
+
end
|
72
|
+
|
73
|
+
class Prism::EmbDocComment < Prism::Comment
|
74
|
+
end
|
75
|
+
|
76
|
+
class Prism::DATAComment < Prism::Comment
|
77
|
+
end
|
78
|
+
|
79
|
+
class Prism::Location
|
80
|
+
sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void }
|
81
|
+
def initialize(source, start_offset, length); end
|
82
|
+
|
83
|
+
sig { returns(String) }
|
84
|
+
def slice; end
|
85
|
+
|
86
|
+
sig { returns(T::Array[Prism::Comment]) }
|
87
|
+
def comments; end
|
88
|
+
|
89
|
+
sig { params(options: T.untyped).returns(Prism::Location) }
|
90
|
+
def copy(**options); end
|
91
|
+
|
92
|
+
sig { returns(Integer) }
|
93
|
+
def start_offset; end
|
94
|
+
|
95
|
+
sig { returns(Integer) }
|
96
|
+
def end_offset; end
|
97
|
+
|
98
|
+
sig { returns(Integer) }
|
99
|
+
def start_line; end
|
100
|
+
|
101
|
+
sig { returns(Integer) }
|
102
|
+
def end_line; end
|
103
|
+
|
104
|
+
sig { returns(Integer) }
|
105
|
+
def start_column; end
|
106
|
+
|
107
|
+
sig { returns(Integer) }
|
108
|
+
def end_column; end
|
109
|
+
end
|
110
|
+
|
111
|
+
class Prism::Source
|
112
|
+
sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void }
|
113
|
+
def initialize(source, start_line, offsets); end
|
114
|
+
|
115
|
+
sig { params(offset: Integer, length: Integer).returns(String) }
|
116
|
+
def slice(offset, length); end
|
117
|
+
|
118
|
+
sig { params(value: Integer).returns(Integer) }
|
119
|
+
def line(value); end
|
120
|
+
|
121
|
+
sig { params(value: Integer).returns(Integer) }
|
122
|
+
def line_offset(value); end
|
123
|
+
|
124
|
+
sig { params(value: Integer).returns(Integer) }
|
125
|
+
def column(value); end
|
126
|
+
|
127
|
+
sig { returns(String) }
|
128
|
+
def source; end
|
129
|
+
|
130
|
+
sig { returns(T::Array[Integer]) }
|
131
|
+
def offsets; end
|
132
|
+
end
|
133
|
+
|
134
|
+
class Prism::Token
|
135
|
+
sig { params(type: T.untyped, value: String, location: Prism::Location).void }
|
136
|
+
def initialize(type, value, location); end
|
137
|
+
|
138
|
+
sig { params(keys: T.untyped).returns(T.untyped) }
|
139
|
+
def deconstruct_keys(keys); end
|
140
|
+
|
141
|
+
sig { params(q: T.untyped).returns(T.untyped) }
|
142
|
+
def pretty_print(q); end
|
143
|
+
|
144
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
145
|
+
def ==(other); end
|
146
|
+
|
147
|
+
sig { returns(T.untyped) }
|
148
|
+
def type; end
|
149
|
+
|
150
|
+
sig { returns(String) }
|
151
|
+
def value; end
|
152
|
+
|
153
|
+
sig { returns(Prism::Location) }
|
154
|
+
def location; end
|
155
|
+
end
|
156
|
+
|
157
|
+
class Prism::NodeInspector
|
158
|
+
sig { params(prefix: String).void }
|
159
|
+
def initialize(prefix); end
|
160
|
+
|
161
|
+
sig { returns(String) }
|
162
|
+
def prefix; end
|
163
|
+
|
164
|
+
sig { returns(String) }
|
165
|
+
def output; end
|
166
|
+
|
167
|
+
# Appends a line to the output with the current prefix.
|
168
|
+
sig { params(line: String).void }
|
169
|
+
def <<(line); end
|
170
|
+
|
171
|
+
# This generates a string that is used as the header of the inspect output
|
172
|
+
# for any given node.
|
173
|
+
sig { params(node: Prism::Node).returns(String) }
|
174
|
+
def header(node); end
|
175
|
+
|
176
|
+
# Generates a string that represents a list of nodes. It handles properly
|
177
|
+
# using the box drawing characters to make the output look nice.
|
178
|
+
sig { params(prefix: String, nodes: T::Array[Prism::Node]).returns(String) }
|
179
|
+
def list(prefix, nodes); end
|
180
|
+
|
181
|
+
# Generates a string that represents a location field on a node.
|
182
|
+
sig { params(value: Prism::Location).returns(String) }
|
183
|
+
def location(value); end
|
184
|
+
|
185
|
+
# Generates a string that represents a child node.
|
186
|
+
sig { params(node: Prism::Node, append: String).returns(String) }
|
187
|
+
def child_node(node, append); end
|
188
|
+
|
189
|
+
# Returns a new inspector that can be used to inspect a child node.
|
190
|
+
sig { params(append: String).returns(Prism::NodeInspector) }
|
191
|
+
def child_inspector(append); end
|
192
|
+
|
193
|
+
# Returns the output as a string.
|
194
|
+
sig { returns(String) }
|
195
|
+
def to_str; end
|
196
|
+
end
|
197
|
+
|
198
|
+
class Prism::BasicVisitor
|
199
|
+
sig { params(node: T.nilable(Prism::Node)).void }
|
200
|
+
def visit(node); end
|
201
|
+
|
202
|
+
sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void }
|
203
|
+
def visit_all(nodes); end
|
204
|
+
|
205
|
+
sig { params(node: Prism::Node).void }
|
206
|
+
def visit_child_nodes(node); end
|
207
|
+
end
|