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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f2e7e51d08feb7b1a562ac43c679da8fc6f0a7cfc2ecef65e11c1e8c3d0d2b9
4
- data.tar.gz: d41ed33c0b5de01cd1746faa3572e56f651ecfc808c046cdb4166a0ec357138e
3
+ metadata.gz: 7a6f33de7616c04fe5e070fe874581fddcd5d6a600371151fe3ff9638669eb89
4
+ data.tar.gz: f95cb049c9f7231886bfa3ea901d45745a86d9c8c2933bc971b6e09830b00245
5
5
  SHA512:
6
- metadata.gz: bc198dc7d40caaa802604cb1f633098955540d838c4e1adcca635da85880703378d981a4f37c528e7f4b3720fc6f152d7fc6c7bcb11ce3e0abba76fd14a6d47c
7
- data.tar.gz: 68c6643f9adf4761bec2a2ffb211e223cb732a37c341652c4625191b5ab6d6791c91196f3c3bc4fd5624d6d853558c33e28f8462f483f923badad8f38498a675
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.1)
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("rbs/extension")
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
@@ -1,3 +1,3 @@
1
1
  require 'mkmf'
2
2
  $INCFLAGS << " -I$(top_srcdir)" if $extmk
3
- create_makefile 'extension'
3
+ create_makefile 'rbs_extension'
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  #include "rbs_extension.h"
2
2
 
3
3
  void
4
- Init_extension(void)
4
+ Init_rbs_extension(void)
5
5
  {
6
6
  rbs__init_constants();
7
7
  rbs__init_location();
@@ -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
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
@@ -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
@@ -20,5 +20,12 @@ module RBS
20
20
  source
21
21
  end
22
22
  end
23
+
24
+ SyntaxError = ParsingError
25
+ SemanticsError = ParsingError
26
+ LexerError = ParsingError
27
+
28
+ class LocatedValue
29
+ end
23
30
  end
24
31
  end
data/lib/rbs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "1.7.0.beta.1"
2
+ VERSION = "1.7.0.beta.2"
3
3
  end
data/lib/rbs.rb CHANGED
@@ -46,7 +46,7 @@ require "rbs/locator"
46
46
  require "rbs/type_alias_dependency"
47
47
  require "rbs/collection"
48
48
 
49
- require "rbs/extension"
49
+ require "rbs_extension"
50
50
  require "rbs/parser_aux"
51
51
  require "rbs/location_aux"
52
52
 
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/rbs/extension/extconf.rb}
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
@@ -18,5 +18,8 @@ module RBS
18
18
 
19
19
  %a{no-defn}
20
20
  def self._parse_signature: (Buffer, Integer line, Integer column) -> Array[AST::Declarations::t]
21
+
22
+ class LocatedValue
23
+ end
21
24
  end
22
25
  end
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.1
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/rbs/extension/extconf.rb
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/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
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