Skip to content

Commit c890df6

Browse files
committed
Add nodoc for FFI backend internals
1 parent 55278f2 commit c890df6

3 files changed

Lines changed: 30 additions & 51 deletions

File tree

lib/prism/ffi/common.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module Prism
66

7-
class Common
7+
class Common # :nodoc:
88
def dump(string, options) # :nodoc:
99
with_buffer do |buffer|
1010
parse_only(buffer, string, options)
@@ -178,27 +178,27 @@ def dump_options(options)
178178

179179
# Required APIs below
180180

181-
def with_buffer(&b)
181+
def with_buffer(&b) # :nodoc:
182182
raise NotImplementedError
183183
end
184184

185-
def with_string(string, &b)
185+
def with_string(string, &b) # :nodoc:
186186
raise NotImplementedError
187187
end
188188

189-
def with_file(string, &b)
189+
def with_file(string, &b) # :nodoc:
190190
raise NotImplementedError
191191
end
192192

193-
def lex_only(buffer, string, options)
193+
def lex_only(buffer, string, options) # :nodoc:
194194
raise NotImplementedError
195195
end
196196

197-
def parse_only(buffer, string, options)
197+
def parse_only(buffer, string, options) # :nodoc:
198198
raise NotImplementedError
199199
end
200200

201-
def parse_stream(buffer, callback, eof_callback, options, source)
201+
def parse_stream(buffer, callback, eof_callback, options, source) # :nodoc:
202202
raise NotImplementedError
203203
end
204204

@@ -214,15 +214,15 @@ def parse_file_success(string, options) # :nodoc:
214214
raise NotImplementedError
215215
end
216216

217-
def string_query_method_name(string)
217+
def string_query_method_name(string) # :nodoc:
218218
raise NotImplementedError
219219
end
220220

221-
def string_query_constant(string)
221+
def string_query_constant(string) # :nodoc:
222222
raise NotImplementedError
223223
end
224224

225-
def string_query_local(string)
225+
def string_query_local(string) # :nodoc:
226226
raise NotImplementedError
227227
end
228228
end

lib/prism/ffi/native_ffi.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,34 +250,34 @@ def self.with_file(filepath)
250250
# the prism module.
251251
private_constant :LibRubyParser
252252

253-
class NativeCommon < Common
253+
class NativeCommon < Common # :nodoc:
254254

255255
# The version constant is set by reading the result of calling pm_version.
256256
def version
257257
LibRubyParser.pm_version.read_string.freeze
258258
end
259259

260-
def with_buffer(&b)
260+
def with_buffer(&b) # :nodoc:
261261
LibRubyParser::NativeBuffer.with(&b)
262262
end
263263

264-
def with_string(string, &b)
264+
def with_string(string, &b) # :nodoc:
265265
LibRubyParser::NativeSource.with_string(string, &b)
266266
end
267267

268-
def with_file(string, &b)
268+
def with_file(string, &b) # :nodoc:
269269
LibRubyParser::NativeSource.with_file(string, &b)
270270
end
271271

272-
def lex_only(buffer, string, options)
272+
def lex_only(buffer, string, options) # :nodoc:
273273
LibRubyParser.pm_serialize_lex(buffer.pointer, string.pointer, string.length, dump_options(options))
274274
end
275275

276-
def parse_only(buffer, string, options)
276+
def parse_only(buffer, string, options) # :nodoc:
277277
LibRubyParser.pm_serialize_parse(buffer.pointer, string.pointer, string.length, dump_options(options))
278278
end
279279

280-
def parse_stream(buffer, callback, eof_callback, options, source)
280+
def parse_stream(buffer, callback, eof_callback, options, source) # :nodoc:
281281
pm_source = LibRubyParser.pm_source_stream_new(nil, callback, eof_callback)
282282
begin
283283
LibRubyParser.pm_serialize_parse_stream(buffer.pointer, pm_source, dump_options(options))
@@ -305,15 +305,15 @@ def parse_file_success(string, options) # :nodoc:
305305
LibRubyParser.pm_serialize_parse_success_p(string.pointer, string.length, dump_options(options))
306306
end
307307

308-
def string_query_method_name(string)
308+
def string_query_method_name(string) # :nodoc:
309309
LibRubyParser.pm_string_query_method_name(string, string.bytesize, string.encoding.name)
310310
end
311311

312-
def string_query_constant(string)
312+
def string_query_constant(string) # :nodoc:
313313
LibRubyParser.pm_string_query_constant(string, string.bytesize, string.encoding.name)
314314
end
315315

316-
def string_query_local(string)
316+
def string_query_local(string) # :nodoc:
317317
LibRubyParser.pm_string_query_local(string, string.bytesize, string.encoding.name)
318318
end
319319
end

lib/prism/ffi/wasm_ffi.rb

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
require_jar('com.dylibso.chicory', 'log', '1.6.1')
2020

2121
module Prism # :nodoc:
22-
class WASMCommon < Common
22+
class WASMCommon < Common # :nodoc:
2323
java_import org.ruby_lang.prism.wasm.Prism
2424

2525
# TODO: concurrency
@@ -30,48 +30,27 @@ def version
3030
WASM::PRISM.version
3131
end
3232

33-
# Prototype WASM code
34-
# def dump(source, **options)
35-
# parsed = WASM::PRISM.parse(source.to_java_bytes, dump_options(options).to_java_bytes)
36-
# end
37-
#
38-
# # Mirror the Prism.dump_file API by using the serialization API.
39-
# def dump_file(filepath, **options)
40-
# dump_file(File.read(filepath), filepath: filepath, **options)
41-
# end
42-
#
43-
# # Mirror the Prism.lex API by using the serialization API.
44-
# def lex(source, **options)
45-
# lexed = WASM::PRISM.lex(source.to_java_bytes, dump_options(options).to_java_bytes)
46-
# Serialize.load_lex(source, lexed, options.fetch(:freeze, false))
47-
# end
48-
#
49-
# # Mirror the Prism.lex_file API by using the serialization API.
50-
# def lex_file(filepath, **options)
51-
# lex_file(File.read(filepath), filepath: filepath, **options)
52-
# end
53-
54-
def with_buffer(&b)
33+
def with_buffer(&b) # :nodoc:
5534
raise NotImplementedError
5635
end
5736

58-
def with_string(string, &b)
37+
def with_string(string, &b) # :nodoc:
5938
raise NotImplementedError
6039
end
6140

62-
def with_file(string, &b)
41+
def with_file(string, &b) # :nodoc:
6342
raise NotImplementedError
6443
end
6544

66-
def lex_only(buffer, string, options)
45+
def lex_only(buffer, string, options) # :nodoc:
6746
raise NotImplementedError
6847
end
6948

70-
def parse_only(buffer, string, options)
49+
def parse_only(buffer, string, options) # :nodoc:
7150
raise NotImplementedError
7251
end
7352

74-
def parse_stream(buffer, callback, eof_callback, options, source)
53+
def parse_stream(buffer, callback, eof_callback, options, source) # :nodoc:
7554
raise NotImplementedError
7655
end
7756

@@ -87,15 +66,15 @@ def parse_file_success(string, options) # :nodoc:
8766
raise NotImplementedError
8867
end
8968

90-
def string_query_method_name(string)
69+
def string_query_method_name(string) # :nodoc:
9170
raise NotImplementedError
9271
end
9372

94-
def string_query_constant(string)
73+
def string_query_constant(string) # :nodoc:
9574
raise NotImplementedError
9675
end
9776

98-
def string_query_local(string)
77+
def string_query_local(string) # :nodoc:
9978
raise NotImplementedError
10079
end
10180
end

0 commit comments

Comments
 (0)