rbs 1.7.0.beta.1 → 1.7.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/Rakefile +1 -1
- data/ext/{rbs/extension → rbs_extension}/constants.c +0 -0
- data/ext/{rbs/extension → rbs_extension}/constants.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/extconf.rb +1 -1
- data/ext/{rbs/extension → rbs_extension}/lexer.c +0 -0
- data/ext/{rbs/extension → rbs_extension}/lexer.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/location.c +0 -0
- data/ext/{rbs/extension → rbs_extension}/location.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/main.c +1 -1
- data/ext/{rbs/extension → rbs_extension}/parser.c +4 -0
- data/ext/{rbs/extension → rbs_extension}/parser.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/parserstate.c +0 -0
- data/ext/{rbs/extension → rbs_extension}/parserstate.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/rbs_extension.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/ruby_objs.c +0 -0
- data/ext/{rbs/extension → rbs_extension}/ruby_objs.h +0 -0
- data/ext/{rbs/extension → rbs_extension}/unescape.c +0 -0
- data/lib/rbs/errors.rb +8 -0
- data/lib/rbs/location_aux.rb +13 -0
- data/lib/rbs/parser_aux.rb +7 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +1 -1
- data/rbs.gemspec +1 -1
- data/sig/errors.rbs +10 -0
- data/sig/location.rbs +5 -0
- data/sig/parser.rbs +3 -0
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a6f33de7616c04fe5e070fe874581fddcd5d6a600371151fe3ff9638669eb89
|
4
|
+
data.tar.gz: f95cb049c9f7231886bfa3ea901d45745a86d9c8c2933bc971b6e09830b00245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71cd7aa025ce3676def36bc814c0fdea25567799ca9b8bcc419fea0c1d75b08fa81d6b5cd568d37e68dce5efce39f0b58007aff1724035c81cadec07fb45f1aa
|
7
|
+
data.tar.gz: 79c51b0a674179e12337b842c3ef6390805b7ce47603efb23ccb96297811524b58b820cc2dcda46b3806df27a598e8bb492d904d530dc7d005861c93674a2eae
|
data/CHANGELOG.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
-
## 1.7.0 (beta.
|
5
|
+
## 1.7.0 (beta.2)
|
6
6
|
|
7
7
|
## Library changes
|
8
8
|
|
9
|
-
* Replace RBS::Parser ([#788](https://github.com/ruby/rbs/pull/788))
|
9
|
+
* Replace RBS::Parser ([#788](https://github.com/ruby/rbs/pull/788), [#789](https://github.com/ruby/rbs/pull/789))
|
10
10
|
|
11
11
|
## 1.6.2 (2021-09-09)
|
12
12
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ ruby = ENV["RUBY"] || RbConfig.ruby
|
|
9
9
|
rbs = File.join(__dir__, "exe/rbs")
|
10
10
|
bin = File.join(__dir__, "bin")
|
11
11
|
|
12
|
-
Rake::ExtensionTask.new("
|
12
|
+
Rake::ExtensionTask.new("rbs_extension")
|
13
13
|
|
14
14
|
Rake::TestTask.new(:test => :compile) do |t|
|
15
15
|
t.libs << "test"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1449,6 +1449,7 @@ VALUE parse_member_def(parserstate *state, bool instance_only, bool accept_overl
|
|
1449
1449
|
parser_advance(state);
|
1450
1450
|
loop = false;
|
1451
1451
|
overload_range = state->current_token.range;
|
1452
|
+
member_range.end = overload_range.end;
|
1452
1453
|
break;
|
1453
1454
|
} else {
|
1454
1455
|
raise_syntax_error(
|
@@ -2280,6 +2281,9 @@ VALUE parse_nested_decl(parserstate *state, const char *nested_in, position anno
|
|
2280
2281
|
case pCOLON2:
|
2281
2282
|
decl = parse_const_decl(state);
|
2282
2283
|
break;
|
2284
|
+
case tGIDENT:
|
2285
|
+
decl = parse_global_decl(state);
|
2286
|
+
break;
|
2283
2287
|
case kTYPE:
|
2284
2288
|
decl = parse_type_decl(state, annot_pos, annotations);
|
2285
2289
|
break;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rbs/errors.rb
CHANGED
@@ -30,6 +30,14 @@ module RBS
|
|
30
30
|
|
31
31
|
super "#{Location.to_string location}: Syntax error: #{error_message}, token=`#{location.source}` (#{token_type})"
|
32
32
|
end
|
33
|
+
|
34
|
+
def error_value
|
35
|
+
location.source
|
36
|
+
end
|
37
|
+
|
38
|
+
def token_str
|
39
|
+
token_type
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
43
|
class InvalidTypeApplicationError < DefinitionError
|
data/lib/rbs/location_aux.rb
CHANGED
@@ -6,6 +6,19 @@ module RBS
|
|
6
6
|
"#<#{self.class}:#{self.__id__} buffer=#{buffer.name}, start=#{start_line}:#{start_column}, pos=#{start_pos}...#{end_pos}, children=#{(rks + ops).join(",")} source='#{source.lines.first&.chomp}'>"
|
7
7
|
end
|
8
8
|
|
9
|
+
def self.new(buffer_ = nil, start_pos_ = nil, end_pos_ = nil, buffer: nil, start_pos: nil, end_pos: nil)
|
10
|
+
__skip__ =
|
11
|
+
begin
|
12
|
+
if buffer && start_pos && end_pos
|
13
|
+
super(buffer, start_pos, end_pos)
|
14
|
+
else
|
15
|
+
super(buffer_, start_pos_, end_pos_)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
WithChildren = self
|
21
|
+
|
9
22
|
def name
|
10
23
|
buffer.name
|
11
24
|
end
|
data/lib/rbs/parser_aux.rb
CHANGED
data/lib/rbs/version.rb
CHANGED
data/lib/rbs.rb
CHANGED
data/rbs.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
31
31
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
|
32
32
|
end
|
33
|
-
spec.extensions = %w{ext/
|
33
|
+
spec.extensions = %w{ext/rbs_extension/extconf.rb}
|
34
34
|
|
35
35
|
spec.bindir = "exe"
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
data/sig/errors.rbs
CHANGED
@@ -24,6 +24,16 @@ module RBS
|
|
24
24
|
attr_reader token_type: String
|
25
25
|
|
26
26
|
def initialize: (Location[untyped, untyped], String error_message, String token_type) -> void
|
27
|
+
|
28
|
+
def error_value: () -> String
|
29
|
+
|
30
|
+
def token_str: () -> String
|
31
|
+
end
|
32
|
+
|
33
|
+
class Parser
|
34
|
+
SemanticsError: singleton(ParsingError)
|
35
|
+
SyntaxError: singleton(ParsingError)
|
36
|
+
LexerError: singleton(ParsingError)
|
27
37
|
end
|
28
38
|
|
29
39
|
# Error class for errors raised during loading environments.
|
data/sig/location.rbs
CHANGED
@@ -20,6 +20,9 @@ module RBS
|
|
20
20
|
|
21
21
|
def initialize: (Buffer, Integer start_pos, Integer end_pos) -> void
|
22
22
|
|
23
|
+
def self.new: (Buffer, Integer start_pos, Integer end_pos) -> instance
|
24
|
+
| (buffer: Buffer, start_pos: Integer, end_pos: Integer) -> instance
|
25
|
+
|
23
26
|
def inspect: () -> String
|
24
27
|
|
25
28
|
# Returns the name of the buffer.
|
@@ -92,5 +95,7 @@ module RBS
|
|
92
95
|
def _add_optional_no_child: (OptionalChildKeys name) -> void
|
93
96
|
def _optional_keys: () -> Array[Symbol]
|
94
97
|
def _required_keys: () -> Array[Symbol]
|
98
|
+
|
99
|
+
WithChildren: singleton(Location)
|
95
100
|
end
|
96
101
|
end
|
data/sig/parser.rbs
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.0.beta.
|
4
|
+
version: 1.7.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
@@ -17,7 +17,7 @@ email:
|
|
17
17
|
executables:
|
18
18
|
- rbs
|
19
19
|
extensions:
|
20
|
-
- ext/
|
20
|
+
- ext/rbs_extension/extconf.rb
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
23
|
- ".github/dependabot.yml"
|
@@ -98,22 +98,22 @@ files:
|
|
98
98
|
- docs/stdlib.md
|
99
99
|
- docs/syntax.md
|
100
100
|
- exe/rbs
|
101
|
-
- ext/
|
102
|
-
- ext/
|
103
|
-
- ext/
|
104
|
-
- ext/
|
105
|
-
- ext/
|
106
|
-
- ext/
|
107
|
-
- ext/
|
108
|
-
- ext/
|
109
|
-
- ext/
|
110
|
-
- ext/
|
111
|
-
- ext/
|
112
|
-
- ext/
|
113
|
-
- ext/
|
114
|
-
- ext/
|
115
|
-
- ext/
|
116
|
-
- ext/
|
101
|
+
- ext/rbs_extension/constants.c
|
102
|
+
- ext/rbs_extension/constants.h
|
103
|
+
- ext/rbs_extension/extconf.rb
|
104
|
+
- ext/rbs_extension/lexer.c
|
105
|
+
- ext/rbs_extension/lexer.h
|
106
|
+
- ext/rbs_extension/location.c
|
107
|
+
- ext/rbs_extension/location.h
|
108
|
+
- ext/rbs_extension/main.c
|
109
|
+
- ext/rbs_extension/parser.c
|
110
|
+
- ext/rbs_extension/parser.h
|
111
|
+
- ext/rbs_extension/parserstate.c
|
112
|
+
- ext/rbs_extension/parserstate.h
|
113
|
+
- ext/rbs_extension/rbs_extension.h
|
114
|
+
- ext/rbs_extension/ruby_objs.c
|
115
|
+
- ext/rbs_extension/ruby_objs.h
|
116
|
+
- ext/rbs_extension/unescape.c
|
117
117
|
- goodcheck.yml
|
118
118
|
- lib/rbs.rb
|
119
119
|
- lib/rbs/ancestor_graph.rb
|