rbs 3.0.4 → 3.1.1

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: be4870f9cbfced10b6cbfe578fc38429fa9c4232fe687a4a4e075a3970db2a0c
4
- data.tar.gz: 837608d29d1541864457f307dbb52c9809bdc92325d8c255414c6034ba6f3b77
3
+ metadata.gz: 38298f073fa4b8e071ba2f38a13640e4143a4a64981e16535a214364ce99a536
4
+ data.tar.gz: 0a818cb58aac7767500da1bd57b4a06d193232a1c8b0fa88537c372af542b180
5
5
  SHA512:
6
- metadata.gz: c3cb35ee898cfe7da1dedac7ff448a201391da32fab7aef37ef0547fb0bdfbf887b8c72fdb2351357501811bfbe6c14f018de92f4ccb81d21833be03b243bcf4
7
- data.tar.gz: 838ef9460abf1ba9e59ae8b5a70a704b1a3b931f83ef86f111f6729434e28680e26df3f2dc5ee367a9b28019fdd542272873eac44a200bf7f70438371582494b
6
+ metadata.gz: cf52478cb1f82d103499796eae6e946925b79faca65cf7c52665ebb9966fcf3d8f2a344bf7806dffe7abe8d8e8f5b49e01c0e4bb58bb54fb870104582a84d2e6
7
+ data.tar.gz: f63f19cff5e7246dc3d9e6fe6c1ed46256eae0f83f6c939d50bda1adb5ff78de8e71c4f9864c6059da338485046ad7b936b8b65d1d838610eebb4bf902013bad
data/CHANGELOG.md CHANGED
@@ -2,6 +2,62 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 3.1.1 (2023-07-18)
6
+
7
+ ### Signature updates
8
+
9
+ * Removed `GC.verify_transient_heap_internal_consistency` ([#1374](https://github.com/ruby/rbs/pull/1374))
10
+
11
+ ### Library changes
12
+
13
+ * Relax rdoc version requirement in RDoc plugin ([#1333](https://github.com/ruby/rbs/pull/1333))
14
+
15
+ #### rbs collection
16
+
17
+ * Spec may be missing when rbs_collection.yaml declares dependency ([#1378](https://github.com/ruby/rbs/pull/1378))
18
+
19
+ ### Miscellaneous
20
+
21
+ * Handle connection error with Resolv_test.rb ([#1356](https://github.com/ruby/rbs/pull/1356))
22
+ * Fix broken CI ([#1353](https://github.com/ruby/rbs/pull/1353))
23
+
24
+ ## 3.1.0 (2023-04-26)
25
+
26
+ ### Signature updates
27
+
28
+ * `Module#attr_*` methods ([#1300](https://github.com/ruby/rbs/pull/1300))
29
+ * `Object#define_singleton_method` ([#1299](https://github.com/ruby/rbs/pull/1299))
30
+ * `String#scan` ([#1297](https://github.com/ruby/rbs/pull/1297))
31
+ * Removed `Gem.datadir` ([#1273](https://github.com/ruby/rbs/pull/1273))
32
+
33
+ ### Language updates
34
+
35
+ ### Library changes
36
+
37
+ * Use fenced code block instead of indented one in .rbs files ([#1312](https://github.com/ruby/rbs/pull/1312))
38
+ * Fix single use clause `:type_name` location ([#1307](https://github.com/ruby/rbs/pull/1307))
39
+ * Fix `InvalidOverloadMethodError` on overloading extended method ([#1294](https://github.com/ruby/rbs/pull/1294))
40
+ * Fix super class of `NoTypeFoundError` from `BaseError` to `DefinitionError` ([#1290](https://github.com/ruby/rbs/pull/1290))
41
+ * Support `#detailed_message` for `NonregularTypeAliasError`, `CyclicTypeParameterBound`, `InconsistentClassModuleAliasError` and `CyclicClassAliasDefinitionError` ([#1289](https://github.com/ruby/rbs/pull/1289))
42
+ * Implement `rbs subtract` command ([#1287](https://github.com/ruby/rbs/pull/1287))
43
+ * Support `#detailed_message` for `InvalidVarianceAnnotationError`, `RecursiveAliasDefinitionError`, `MixinClassError` and `RecursiveTypeAliasError` ([#1285](https://github.com/ruby/rbs/pull/1285))
44
+ * Support `#detailed_message` for `NoTypeError`, `InheritModuleError`, `NoSelfTypeFoundError` and `NoMixinFoundError` ([#1280](https://github.com/ruby/rbs/pull/1280))
45
+ * Validate duplicate type aliases ([#1279](https://github.com/ruby/rbs/pull/1279))
46
+ * Add `-e`, `--type`, and `--method-type` options to `rbs parse` ([#1252](https://github.com/ruby/rbs/pull/1252))
47
+
48
+ #### rbs prototype
49
+
50
+ * Convert `include` in `class << self` to `extend` by `prototype rb` ([#1255](https://github.com/ruby/rbs/pull/1255))
51
+
52
+ #### rbs collection
53
+
54
+ * Skip loading `#gemspec` gems via RBS collection ([#1319](https://github.com/ruby/rbs/pull/1319))
55
+
56
+ ### Miscellaneous
57
+
58
+ * Run `bundle install` automatically in `bin/steep` ([#1308](https://github.com/ruby/rbs/pull/1308))
59
+ * Fix warnings ([#1314](https://github.com/ruby/rbs/pull/1314))
60
+
5
61
  ## 3.0.4 (2023-03-13)
6
62
 
7
63
  ### Library changes
data/Gemfile CHANGED
@@ -18,7 +18,7 @@ gem "dbm"
18
18
  gem 'digest'
19
19
  gem 'tempfile'
20
20
  gem "prime"
21
- gem "rdoc", "< 6.5.0"
21
+ gem "rdoc", "~> 6.4.0"
22
22
 
23
23
  # Test gems
24
24
  gem "rbs-amber", path: "test/assets/test-gem"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.0.4)
4
+ rbs (3.1.1)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
@@ -11,13 +11,13 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- addressable (2.8.0)
15
- public_suffix (>= 2.0.2, < 5.0)
14
+ addressable (2.8.4)
15
+ public_suffix (>= 2.0.2, < 6.0)
16
16
  ast (2.4.2)
17
17
  dbm (1.1.0)
18
18
  debase (0.2.5.beta2)
19
19
  debase-ruby_core_source (>= 0.10.12)
20
- debase-ruby_core_source (3.2.0)
20
+ debase-ruby_core_source (3.2.1)
21
21
  diff-lcs (1.5.0)
22
22
  digest (3.1.1)
23
23
  forwardable (1.3.2)
@@ -27,27 +27,29 @@ GEM
27
27
  rainbow (>= 3.0, < 4.0)
28
28
  strong_json (>= 1.1, < 2.2)
29
29
  json (2.6.3)
30
- json-schema (3.0.0)
30
+ json-schema (4.0.0)
31
31
  addressable (>= 2.8)
32
32
  marcel (1.0.2)
33
- minitest (5.17.0)
34
- parallel (1.22.1)
35
- parser (3.2.1.0)
33
+ minitest (5.18.0)
34
+ parallel (1.23.0)
35
+ parser (3.2.2.3)
36
36
  ast (~> 2.4.1)
37
- power_assert (2.0.2)
37
+ racc
38
+ power_assert (2.0.3)
38
39
  prime (0.1.2)
39
40
  forwardable
40
41
  singleton
41
42
  psych (4.0.6)
42
43
  stringio
43
- public_suffix (4.0.7)
44
+ public_suffix (5.0.1)
45
+ racc (1.7.1)
44
46
  rainbow (3.1.1)
45
47
  rake (13.0.6)
46
- rake-compiler (1.2.1)
48
+ rake-compiler (1.2.2)
47
49
  rake
48
50
  rdoc (6.4.0)
49
51
  psych (>= 4.0.0)
50
- regexp_parser (2.7.0)
52
+ regexp_parser (2.8.1)
51
53
  rexml (3.2.5)
52
54
  rspec (3.12.0)
53
55
  rspec-core (~> 3.12.0)
@@ -62,29 +64,29 @@ GEM
62
64
  diff-lcs (>= 1.2.0, < 2.0)
63
65
  rspec-support (~> 3.12.0)
64
66
  rspec-support (3.12.0)
65
- rubocop (1.45.1)
67
+ rubocop (1.52.1)
66
68
  json (~> 2.3)
67
69
  parallel (~> 1.10)
68
- parser (>= 3.2.0.0)
70
+ parser (>= 3.2.2.3)
69
71
  rainbow (>= 2.2.2, < 4.0)
70
72
  regexp_parser (>= 1.8, < 3.0)
71
73
  rexml (>= 3.2.5, < 4.0)
72
- rubocop-ast (>= 1.24.1, < 2.0)
74
+ rubocop-ast (>= 1.28.0, < 2.0)
73
75
  ruby-progressbar (~> 1.7)
74
76
  unicode-display_width (>= 2.4.0, < 3.0)
75
- rubocop-ast (1.26.0)
77
+ rubocop-ast (1.29.0)
76
78
  parser (>= 3.2.1.0)
77
79
  rubocop-rubycw (0.1.6)
78
80
  rubocop (~> 1.0)
79
81
  ruby-debug-ide (0.7.3)
80
82
  rake (>= 0.8.1)
81
- ruby-progressbar (1.11.0)
83
+ ruby-progressbar (1.13.0)
82
84
  singleton (0.1.1)
83
- stackprof (0.2.23)
84
- stringio (3.0.4)
85
+ stackprof (0.2.25)
86
+ stringio (3.0.7)
85
87
  strong_json (2.1.2)
86
88
  tempfile (0.1.3)
87
- test-unit (3.5.7)
89
+ test-unit (3.5.9)
88
90
  power_assert
89
91
  unicode-display_width (2.4.2)
90
92
 
@@ -105,7 +107,7 @@ DEPENDENCIES
105
107
  rake-compiler
106
108
  rbs!
107
109
  rbs-amber!
108
- rdoc (< 6.5.0)
110
+ rdoc (~> 6.4.0)
109
111
  rspec
110
112
  rubocop
111
113
  rubocop-rubycw
data/Steepfile CHANGED
@@ -9,7 +9,7 @@ target :lib do
9
9
  "lib/rbs/test.rb"
10
10
  )
11
11
 
12
- library "set", "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest'
12
+ library "set", "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'abbrev'
13
13
  signature 'stdlib/yaml/0'
14
14
  signature "stdlib/strscan/0/"
15
15
  signature "stdlib/optparse/0/"
data/core/file.rbs CHANGED
@@ -1971,67 +1971,171 @@ File::SEPARATOR: String
1971
1971
  #
1972
1972
  File::Separator: String
1973
1973
 
1974
+ # <!-- rdoc-file=file.c -->
1975
+ # File::Constants provides file-related constants. All possible file constants
1976
+ # are listed in the documentation but they may not all be present on your
1977
+ # platform.
1978
+ #
1979
+ # If the underlying platform doesn't define a constant the corresponding Ruby
1980
+ # constant is not defined.
1981
+ #
1982
+ # Your platform documentations (e.g. man open(2)) may describe more detailed
1983
+ # information.
1984
+ #
1974
1985
  module File::Constants
1975
1986
  end
1976
1987
 
1988
+ # <!-- rdoc-file=file.c -->
1989
+ # append on each write
1990
+ #
1977
1991
  File::Constants::APPEND: Integer
1978
1992
 
1993
+ # <!-- rdoc-file=file.c -->
1994
+ # disable line code conversion
1995
+ #
1979
1996
  File::Constants::BINARY: Integer
1980
1997
 
1998
+ # <!-- rdoc-file=file.c -->
1999
+ # create file if it does not exist
2000
+ #
1981
2001
  File::Constants::CREAT: Integer
1982
2002
 
2003
+ # <!-- rdoc-file=file.c -->
2004
+ # Try to minimize cache effects of the I/O to and from this file.
2005
+ #
1983
2006
  File::Constants::DIRECT: Integer
1984
2007
 
2008
+ # <!-- rdoc-file=file.c -->
2009
+ # any write operation perform synchronously except some meta data
2010
+ #
1985
2011
  File::Constants::DSYNC: Integer
1986
2012
 
2013
+ # <!-- rdoc-file=file.c -->
2014
+ # error if CREAT and the file exists
2015
+ #
1987
2016
  File::Constants::EXCL: Integer
1988
2017
 
2018
+ # <!-- rdoc-file=dir.c -->
2019
+ # Makes File.fnmatch patterns case insensitive (but not Dir.glob patterns).
2020
+ #
1989
2021
  File::Constants::FNM_CASEFOLD: Integer
1990
2022
 
2023
+ # <!-- rdoc-file=dir.c -->
2024
+ # The '*' wildcard matches filenames starting with "." in File.fnmatch and
2025
+ # Dir.glob patterns
2026
+ #
1991
2027
  File::Constants::FNM_DOTMATCH: Integer
1992
2028
 
2029
+ # <!-- rdoc-file=dir.c -->
2030
+ # Allows file globbing through "{a,b}" in File.fnmatch patterns.
2031
+ #
1993
2032
  File::Constants::FNM_EXTGLOB: Integer
1994
2033
 
2034
+ # <!-- rdoc-file=dir.c -->
2035
+ # Disables escapes in File.fnmatch and Dir.glob patterns
2036
+ #
1995
2037
  File::Constants::FNM_NOESCAPE: Integer
1996
2038
 
2039
+ # <!-- rdoc-file=dir.c -->
2040
+ # Wildcards in File.fnmatch and Dir.glob patterns do not match directory
2041
+ # separators
2042
+ #
1997
2043
  File::Constants::FNM_PATHNAME: Integer
1998
2044
 
2045
+ # <!-- rdoc-file=dir.c -->
2046
+ # Makes patterns to match short names if existing. Valid only on Microsoft
2047
+ # Windows.
2048
+ #
1999
2049
  File::Constants::FNM_SHORTNAME: Integer
2000
2050
 
2051
+ # <!-- rdoc-file=dir.c -->
2052
+ # System default case insensitiveness, equals to FNM_CASEFOLD or 0.
2053
+ #
2001
2054
  File::Constants::FNM_SYSCASE: Integer
2002
2055
 
2056
+ # <!-- rdoc-file=file.c -->
2057
+ # exclusive lock. see File#flock
2058
+ #
2003
2059
  File::Constants::LOCK_EX: Integer
2004
2060
 
2061
+ # <!-- rdoc-file=file.c -->
2062
+ # non-blocking lock. used with LOCK_SH or LOCK_EX. see File#flock
2063
+ #
2005
2064
  File::Constants::LOCK_NB: Integer
2006
2065
 
2066
+ # <!-- rdoc-file=file.c -->
2067
+ # shared lock. see File#flock
2068
+ #
2007
2069
  File::Constants::LOCK_SH: Integer
2008
2070
 
2071
+ # <!-- rdoc-file=file.c -->
2072
+ # unlock. see File#flock
2073
+ #
2009
2074
  File::Constants::LOCK_UN: Integer
2010
2075
 
2076
+ # <!-- rdoc-file=file.c -->
2077
+ # do not change atime
2078
+ #
2011
2079
  File::Constants::NOATIME: Integer
2012
2080
 
2081
+ # <!-- rdoc-file=file.c -->
2082
+ # not to make opened IO the controlling terminal device
2083
+ #
2013
2084
  File::Constants::NOCTTY: Integer
2014
2085
 
2086
+ # <!-- rdoc-file=file.c -->
2087
+ # do not follow symlinks
2088
+ #
2015
2089
  File::Constants::NOFOLLOW: Integer
2016
2090
 
2091
+ # <!-- rdoc-file=file.c -->
2092
+ # do not block on open or for data to become available
2093
+ #
2017
2094
  File::Constants::NONBLOCK: Integer
2018
2095
 
2096
+ # <!-- rdoc-file=file.c -->
2097
+ # Name of the null device
2098
+ #
2019
2099
  File::Constants::NULL: String
2020
2100
 
2101
+ # <!-- rdoc-file=file.c -->
2102
+ # open for reading only
2103
+ #
2021
2104
  File::Constants::RDONLY: Integer
2022
2105
 
2106
+ # <!-- rdoc-file=file.c -->
2107
+ # open for reading and writing
2108
+ #
2023
2109
  File::Constants::RDWR: Integer
2024
2110
 
2111
+ # <!-- rdoc-file=file.c -->
2112
+ # any read operation perform synchronously. used with SYNC or DSYNC.
2113
+ #
2025
2114
  File::Constants::RSYNC: Integer
2026
2115
 
2116
+ # <!-- rdoc-file=file.c -->
2117
+ # can delete opened file
2118
+ #
2027
2119
  File::Constants::SHARE_DELETE: Integer
2028
2120
 
2121
+ # <!-- rdoc-file=file.c -->
2122
+ # any write operation perform synchronously
2123
+ #
2029
2124
  File::Constants::SYNC: Integer
2030
2125
 
2126
+ # <!-- rdoc-file=file.c -->
2127
+ # Create an unnamed temporary file
2128
+ #
2031
2129
  File::Constants::TMPFILE: Integer
2032
2130
 
2131
+ # <!-- rdoc-file=file.c -->
2132
+ # truncate size to 0
2133
+ #
2033
2134
  File::Constants::TRUNC: Integer
2034
2135
 
2136
+ # <!-- rdoc-file=file.c -->
2137
+ # open for writing only
2138
+ #
2035
2139
  File::Constants::WRONLY: Integer
2036
2140
 
2037
2141
  # <!-- rdoc-file=file.c -->
data/core/gc.rbs CHANGED
@@ -234,13 +234,6 @@ module GC
234
234
  #
235
235
  def self.verify_internal_consistency: () -> nil
236
236
 
237
- # <!--
238
- # rdoc-file=gc.c
239
- # - verify_transient_heap_internal_consistency()
240
- # -->
241
- #
242
- def self.verify_transient_heap_internal_consistency: () -> nil
243
-
244
237
  # <!--
245
238
  # rdoc-file=gc.rb
246
239
  # - GC.latest_gc_info -> hash
data/core/io/buffer.rbs CHANGED
@@ -541,13 +541,11 @@ class IO
541
541
 
542
542
  # <!--
543
543
  # rdoc-file=io_buffer.c
544
- # - read(io, [length, [offset]]) -> read length or -errno
544
+ # - read(io, length, [offset]) -> read length or -errno
545
545
  # -->
546
546
  # Read at most `length` bytes from `io` into the buffer, starting at `offset`.
547
547
  # If an error occurs, return `-errno`.
548
548
  #
549
- # If `length` is not given, read until the end of the buffer.
550
- #
551
549
  # If `offset` is not given, read from the beginning of the buffer.
552
550
  #
553
551
  # If `length` is 0, read nothing.
data/core/module.rbs CHANGED
@@ -284,7 +284,7 @@ class Module < Object
284
284
  # end
285
285
  # Mod.instance_methods.sort #=> [:one, :one=, :two, :two=]
286
286
  #
287
- def attr_accessor: (*Symbol | String arg0) -> Array[Symbol]
287
+ def attr_accessor: (*Object::name arg0) -> Array[Symbol]
288
288
 
289
289
  # <!--
290
290
  # rdoc-file=object.c
@@ -298,7 +298,7 @@ class Module < Object
298
298
  # in turn. String arguments are converted to symbols. Returns an array of
299
299
  # defined method names as symbols.
300
300
  #
301
- def attr_reader: (*Symbol | String arg0) -> Array[Symbol]
301
+ def attr_reader: (*Object::name arg0) -> Array[Symbol]
302
302
 
303
303
  # <!--
304
304
  # rdoc-file=object.c
@@ -309,7 +309,7 @@ class Module < Object
309
309
  # *symbol*`.id2name`. String arguments are converted to symbols. Returns an
310
310
  # array of defined method names as symbols.
311
311
  #
312
- def attr_writer: (*Symbol | String arg0) -> Array[Symbol]
312
+ def attr_writer: (*Object::name arg0) -> Array[Symbol]
313
313
 
314
314
  # <!--
315
315
  # rdoc-file=load.c
@@ -1629,5 +1629,5 @@ class Module < Object
1629
1629
  # `attr_reader(name)` but deprecated. Returns an array of defined method names
1630
1630
  # as symbols.
1631
1631
  #
1632
- def attr: (*Symbol | String arg0) -> Array[Symbol]
1632
+ def attr: (*Object::name arg0) -> Array[Symbol]
1633
1633
  end
data/core/object.rbs CHANGED
@@ -205,8 +205,8 @@ class Object < BasicObject
205
205
  # chris.define_singleton_method(:greet) {|greeting| "#{greeting}, I'm Chris!" }
206
206
  # chris.greet("Hi") #=> "Hi, I'm Chris!"
207
207
  #
208
- def define_singleton_method: (Symbol, Method | UnboundMethod) -> Symbol
209
- | (Symbol) { (*untyped) -> untyped } -> Symbol
208
+ def define_singleton_method: (name, Method | UnboundMethod) -> Symbol
209
+ | (name) { (*untyped) -> untyped } -> Symbol
210
210
 
211
211
  # <!--
212
212
  # rdoc-file=io.c
data/core/process.rbs CHANGED
@@ -1645,6 +1645,9 @@ module Process::UID
1645
1645
  def self.eid=: (Integer user) -> Integer
1646
1646
  end
1647
1647
 
1648
+ # <!-- rdoc-file=process.c -->
1649
+ # Placeholder for rusage
1650
+ #
1648
1651
  class Process::Tms < Struct[Float]
1649
1652
  end
1650
1653
 
@@ -261,15 +261,6 @@ module Gem
261
261
  #
262
262
  def self.data_home: () -> String
263
263
 
264
- # <!--
265
- # rdoc-file=lib/rubygems.rb
266
- # - datadir(gem_name)
267
- # -->
268
- # The path to the data directory specified by the gem name. If the package is
269
- # not available as a gem, return nil.
270
- #
271
- def self.datadir: (String gem_name) -> String?
272
-
273
264
  # <!--
274
265
  # rdoc-file=lib/rubygems/defaults.rb
275
266
  # - default_bindir()
data/core/string.rbs CHANGED
@@ -2600,8 +2600,10 @@ class String
2600
2600
  # <<cruel>> <<world>>
2601
2601
  # rceu lowlr
2602
2602
  #
2603
- def scan: (Regexp | string pattern) -> Array[String | Array[String]]
2604
- | (Regexp | string pattern) { (String | Array[String]) -> void } -> self
2603
+ def scan: (Regexp pattern) -> Array[String | Array[String]]
2604
+ | (Regexp pattern) { (String | Array[String]) -> void } -> self
2605
+ | (string pattern) -> Array[String]
2606
+ | (string pattern) { (String) -> void } -> self
2605
2607
 
2606
2608
  # <!--
2607
2609
  # rdoc-file=string.c
@@ -2649,13 +2649,9 @@ void parse_use_clauses(parserstate *state, VALUE clauses) {
2649
2649
 
2650
2650
  VALUE location = rbs_new_location(state->buffer, clause_range);
2651
2651
  rbs_loc *loc = rbs_check_location(location);
2652
- rbs_loc_add_required_child(loc, rb_intern("type_name"), state->current_token.range);
2653
- if (!null_range_p(keyword_range)) {
2654
- rbs_loc_add_optional_child(loc, rb_intern("keyword"), keyword_range);
2655
- }
2656
- if (!null_range_p(new_name_range)) {
2657
- rbs_loc_add_optional_child(loc, rb_intern("new_name"), new_name_range);
2658
- }
2652
+ rbs_loc_add_required_child(loc, rb_intern("type_name"), type_name_range);
2653
+ rbs_loc_add_optional_child(loc, rb_intern("keyword"), keyword_range);
2654
+ rbs_loc_add_optional_child(loc, rb_intern("new_name"), new_name_range);
2659
2655
 
2660
2656
  rb_ary_push(clauses, rbs_ast_directives_use_single_clause(type_name, new_name, location));
2661
2657
 
@@ -2739,7 +2735,7 @@ VALUE parse_signature(parserstate *state) {
2739
2735
  }
2740
2736
 
2741
2737
  static VALUE
2742
- rbsparser_parse_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables)
2738
+ rbsparser_parse_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof)
2743
2739
  {
2744
2740
  parserstate *parser = alloc_parser(buffer, FIX2INT(start_pos), FIX2INT(end_pos), variables);
2745
2741
 
@@ -2749,13 +2745,17 @@ rbsparser_parse_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, V
2749
2745
 
2750
2746
  VALUE type = parse_type(parser);
2751
2747
 
2748
+ if (RB_TEST(require_eof)) {
2749
+ parser_advance_assert(parser, pEOF);
2750
+ }
2751
+
2752
2752
  free_parser(parser);
2753
2753
 
2754
2754
  return type;
2755
2755
  }
2756
2756
 
2757
2757
  static VALUE
2758
- rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables)
2758
+ rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof)
2759
2759
  {
2760
2760
  parserstate *parser = alloc_parser(buffer, FIX2INT(start_pos), FIX2INT(end_pos), variables);
2761
2761
 
@@ -2765,6 +2765,10 @@ rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end
2765
2765
 
2766
2766
  VALUE method_type = parse_method_type(parser);
2767
2767
 
2768
+ if (RB_TEST(require_eof)) {
2769
+ parser_advance_assert(parser, pEOF);
2770
+ }
2771
+
2768
2772
  free_parser(parser);
2769
2773
 
2770
2774
  return method_type;
@@ -2782,7 +2786,7 @@ rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE end_pos)
2782
2786
 
2783
2787
  void rbs__init_parser(void) {
2784
2788
  RBS_Parser = rb_define_class_under(RBS, "Parser", rb_cObject);
2785
- rb_define_singleton_method(RBS_Parser, "_parse_type", rbsparser_parse_type, 4);
2786
- rb_define_singleton_method(RBS_Parser, "_parse_method_type", rbsparser_parse_method_type, 4);
2789
+ rb_define_singleton_method(RBS_Parser, "_parse_type", rbsparser_parse_type, 5);
2790
+ rb_define_singleton_method(RBS_Parser, "_parse_method_type", rbsparser_parse_method_type, 5);
2787
2791
  rb_define_singleton_method(RBS_Parser, "_parse_signature", rbsparser_parse_signature, 2);
2788
2792
  }