Skip to content

Commit d20362a

Browse files
committed
Initial Ruby stubs for FFI version
1 parent a60a6ad commit d20362a

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

lib/rbs.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
require "rbs/type_alias_regularity"
7070
require "rbs/collection"
7171

72-
require "rbs_extension"
72+
begin
73+
require "rbs_extension"
74+
rescue LoadError
75+
require "rbs/ffi/parser"
76+
require "rbs/ffi/location"
77+
end
7378
require "rbs/parser_aux"
7479
require "rbs/location_aux"
7580

lib/rbs/ffi/location.rb

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
module RBS
2+
class Location
3+
def initialize(buffer, start_pos, end_pos)
4+
5+
end
6+
7+
def initialize_copy(other)
8+
9+
end
10+
11+
def buffer
12+
13+
end
14+
15+
def _start_pos
16+
17+
end
18+
19+
def _end_pos
20+
21+
end
22+
23+
def _add_required_child(name, start, end_pos)
24+
25+
end
26+
27+
def _add_optional_child(name, start, end_pos)
28+
29+
end
30+
31+
def _add_optional_no_child(name)
32+
33+
end
34+
35+
def _optional_keys
36+
37+
end
38+
39+
def _required_keys
40+
41+
end
42+
43+
def [](name)
44+
45+
end
46+
end
47+
end

lib/rbs/ffi/parser.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module RBS
2+
class Parser
3+
def _parse_type(buffer, start_pos, end_pos, variables, require_eof)
4+
5+
end
6+
7+
def _parse_method_type(buffer, start_pos, end_pos, variables, require_eof)
8+
9+
end
10+
11+
def _parse_signature(buffer, start_pos, end_pos)
12+
13+
end
14+
15+
def _parse_type_params(buffer, start_pos, end_pos, module_type_params)
16+
17+
end
18+
19+
def _parse_inline_leading_annotation(buffer, start_pos, end_pos, variables)
20+
21+
end
22+
23+
def _parse_inline_trailing_annotation(buffer, start_pos, end_pos, variables)
24+
25+
end
26+
end
27+
end

0 commit comments

Comments
 (0)