rbs 4.0.0.dev.5 → 4.0.1.dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +1 -0
  3. data/.github/workflows/c-check.yml +8 -4
  4. data/.github/workflows/comments.yml +3 -1
  5. data/.github/workflows/dependabot.yml +1 -1
  6. data/.github/workflows/ruby.yml +10 -0
  7. data/.github/workflows/rust.yml +95 -0
  8. data/CHANGELOG.md +323 -0
  9. data/Rakefile +12 -29
  10. data/Steepfile +1 -0
  11. data/config.yml +393 -37
  12. data/core/array.rbs +218 -188
  13. data/core/basic_object.rbs +9 -8
  14. data/core/class.rbs +6 -5
  15. data/core/comparable.rbs +45 -31
  16. data/core/complex.rbs +52 -40
  17. data/core/dir.rbs +57 -45
  18. data/core/encoding.rbs +5 -5
  19. data/core/enumerable.rbs +96 -91
  20. data/core/enumerator.rbs +4 -3
  21. data/core/errno.rbs +3 -2
  22. data/core/errors.rbs +31 -29
  23. data/core/exception.rbs +12 -12
  24. data/core/fiber.rbs +36 -36
  25. data/core/file.rbs +186 -113
  26. data/core/file_test.rbs +2 -2
  27. data/core/float.rbs +41 -32
  28. data/core/gc.rbs +78 -70
  29. data/core/hash.rbs +70 -60
  30. data/core/integer.rbs +32 -28
  31. data/core/io/buffer.rbs +36 -36
  32. data/core/io/wait.rbs +7 -7
  33. data/core/io.rbs +120 -135
  34. data/core/kernel.rbs +189 -139
  35. data/core/marshal.rbs +3 -3
  36. data/core/match_data.rbs +14 -12
  37. data/core/math.rbs +69 -67
  38. data/core/method.rbs +6 -6
  39. data/core/module.rbs +146 -85
  40. data/core/nil_class.rbs +4 -3
  41. data/core/numeric.rbs +35 -32
  42. data/core/object.rbs +6 -8
  43. data/core/object_space.rbs +11 -10
  44. data/core/pathname.rbs +131 -81
  45. data/core/proc.rbs +65 -33
  46. data/core/process.rbs +219 -201
  47. data/core/ractor.rbs +15 -11
  48. data/core/random.rbs +4 -3
  49. data/core/range.rbs +52 -47
  50. data/core/rational.rbs +5 -5
  51. data/core/rbs/unnamed/argf.rbs +58 -51
  52. data/core/rbs/unnamed/env_class.rbs +18 -13
  53. data/core/rbs/unnamed/main_class.rbs +123 -0
  54. data/core/rbs/unnamed/random.rbs +7 -5
  55. data/core/regexp.rbs +236 -197
  56. data/core/ruby.rbs +1 -1
  57. data/core/ruby_vm.rbs +32 -30
  58. data/core/rubygems/config_file.rbs +5 -5
  59. data/core/rubygems/errors.rbs +1 -1
  60. data/core/rubygems/requirement.rbs +5 -5
  61. data/core/rubygems/rubygems.rbs +5 -3
  62. data/core/set.rbs +17 -16
  63. data/core/signal.rbs +2 -2
  64. data/core/string.rbs +311 -292
  65. data/core/struct.rbs +26 -25
  66. data/core/symbol.rbs +25 -24
  67. data/core/thread.rbs +40 -34
  68. data/core/time.rbs +47 -42
  69. data/core/trace_point.rbs +34 -31
  70. data/core/true_class.rbs +2 -2
  71. data/core/unbound_method.rbs +10 -10
  72. data/core/warning.rbs +7 -7
  73. data/docs/collection.md +1 -1
  74. data/docs/config.md +171 -0
  75. data/docs/inline.md +110 -4
  76. data/docs/syntax.md +13 -12
  77. data/ext/rbs_extension/ast_translation.c +489 -135
  78. data/ext/rbs_extension/class_constants.c +8 -0
  79. data/ext/rbs_extension/class_constants.h +4 -0
  80. data/ext/rbs_extension/legacy_location.c +28 -51
  81. data/ext/rbs_extension/legacy_location.h +37 -0
  82. data/ext/rbs_extension/main.c +12 -20
  83. data/include/rbs/ast.h +423 -195
  84. data/include/rbs/lexer.h +2 -2
  85. data/include/rbs/location.h +25 -44
  86. data/include/rbs/parser.h +2 -2
  87. data/include/rbs/util/rbs_constant_pool.h +0 -3
  88. data/include/rbs.h +8 -0
  89. data/lib/rbs/ast/ruby/annotations.rb +157 -4
  90. data/lib/rbs/ast/ruby/members.rb +374 -22
  91. data/lib/rbs/cli/validate.rb +5 -60
  92. data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
  93. data/lib/rbs/definition_builder.rb +60 -27
  94. data/lib/rbs/errors.rb +0 -11
  95. data/lib/rbs/inline_parser.rb +1 -1
  96. data/lib/rbs/parser_aux.rb +20 -7
  97. data/lib/rbs/prototype/helpers.rb +57 -0
  98. data/lib/rbs/prototype/rb.rb +1 -26
  99. data/lib/rbs/prototype/rbi.rb +1 -20
  100. data/lib/rbs/test/type_check.rb +3 -0
  101. data/lib/rbs/types.rb +62 -52
  102. data/lib/rbs/unit_test/type_assertions.rb +35 -8
  103. data/lib/rbs/version.rb +1 -1
  104. data/lib/rbs.rb +0 -1
  105. data/rbs.gemspec +1 -1
  106. data/rust/.gitignore +1 -0
  107. data/rust/Cargo.lock +378 -0
  108. data/rust/Cargo.toml +7 -0
  109. data/rust/ruby-rbs/Cargo.toml +22 -0
  110. data/rust/ruby-rbs/build.rs +764 -0
  111. data/rust/ruby-rbs/examples/locations.rs +60 -0
  112. data/rust/ruby-rbs/src/lib.rs +1 -0
  113. data/rust/ruby-rbs/src/node/mod.rs +742 -0
  114. data/rust/ruby-rbs/tests/sanity.rs +47 -0
  115. data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
  116. data/rust/ruby-rbs-sys/Cargo.toml +23 -0
  117. data/rust/ruby-rbs-sys/build.rs +204 -0
  118. data/rust/ruby-rbs-sys/src/lib.rs +50 -0
  119. data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
  120. data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
  121. data/rust/ruby-rbs-sys/wrapper.h +1 -0
  122. data/sig/ast/ruby/annotations.rbs +191 -4
  123. data/sig/ast/ruby/members.rbs +21 -1
  124. data/sig/cli/validate.rbs +1 -6
  125. data/sig/definition_builder.rbs +2 -0
  126. data/sig/errors.rbs +0 -8
  127. data/sig/method_types.rbs +1 -1
  128. data/sig/parser.rbs +17 -13
  129. data/sig/prototype/helpers.rbs +2 -0
  130. data/sig/types.rbs +10 -11
  131. data/sig/unit_test/spy.rbs +0 -8
  132. data/sig/unit_test/type_assertions.rbs +11 -0
  133. data/src/ast.c +339 -161
  134. data/src/lexstate.c +1 -1
  135. data/src/location.c +7 -47
  136. data/src/parser.c +674 -480
  137. data/src/util/rbs_constant_pool.c +0 -4
  138. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
  139. data/stdlib/cgi-escape/0/escape.rbs +4 -4
  140. data/stdlib/coverage/0/coverage.rbs +4 -3
  141. data/stdlib/date/0/date.rbs +33 -28
  142. data/stdlib/date/0/date_time.rbs +24 -23
  143. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  144. data/stdlib/erb/0/erb.rbs +64 -53
  145. data/stdlib/etc/0/etc.rbs +55 -50
  146. data/stdlib/fileutils/0/fileutils.rbs +138 -125
  147. data/stdlib/forwardable/0/forwardable.rbs +10 -10
  148. data/stdlib/io-console/0/io-console.rbs +2 -2
  149. data/stdlib/json/0/json.rbs +135 -108
  150. data/stdlib/monitor/0/monitor.rbs +3 -3
  151. data/stdlib/net-http/0/net-http.rbs +159 -134
  152. data/stdlib/objspace/0/objspace.rbs +8 -7
  153. data/stdlib/open-uri/0/open-uri.rbs +8 -8
  154. data/stdlib/open3/0/open3.rbs +36 -35
  155. data/stdlib/openssl/0/openssl.rbs +144 -129
  156. data/stdlib/optparse/0/optparse.rbs +18 -14
  157. data/stdlib/pathname/0/pathname.rbs +2 -2
  158. data/stdlib/pp/0/pp.rbs +9 -8
  159. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  160. data/stdlib/pstore/0/pstore.rbs +35 -30
  161. data/stdlib/psych/0/psych.rbs +61 -8
  162. data/stdlib/psych/0/store.rbs +2 -4
  163. data/stdlib/pty/0/pty.rbs +9 -6
  164. data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
  165. data/stdlib/ripper/0/ripper.rbs +20 -17
  166. data/stdlib/securerandom/0/securerandom.rbs +1 -1
  167. data/stdlib/shellwords/0/shellwords.rbs +2 -2
  168. data/stdlib/socket/0/addrinfo.rbs +7 -7
  169. data/stdlib/socket/0/basic_socket.rbs +3 -3
  170. data/stdlib/socket/0/ip_socket.rbs +10 -8
  171. data/stdlib/socket/0/socket.rbs +10 -9
  172. data/stdlib/socket/0/tcp_server.rbs +1 -1
  173. data/stdlib/socket/0/tcp_socket.rbs +1 -1
  174. data/stdlib/socket/0/udp_socket.rbs +1 -1
  175. data/stdlib/socket/0/unix_server.rbs +1 -1
  176. data/stdlib/stringio/0/stringio.rbs +55 -54
  177. data/stdlib/strscan/0/string_scanner.rbs +46 -44
  178. data/stdlib/tempfile/0/tempfile.rbs +24 -20
  179. data/stdlib/time/0/time.rbs +7 -5
  180. data/stdlib/tsort/0/tsort.rbs +7 -6
  181. data/stdlib/uri/0/common.rbs +26 -18
  182. data/stdlib/uri/0/file.rbs +2 -2
  183. data/stdlib/uri/0/generic.rbs +2 -2
  184. data/stdlib/uri/0/http.rbs +2 -2
  185. data/stdlib/uri/0/ldap.rbs +2 -2
  186. data/stdlib/uri/0/mailto.rbs +3 -3
  187. data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
  188. data/stdlib/zlib/0/deflate.rbs +4 -3
  189. data/stdlib/zlib/0/gzip_reader.rbs +4 -4
  190. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  191. data/stdlib/zlib/0/inflate.rbs +1 -1
  192. data/stdlib/zlib/0/need_dict.rbs +1 -1
  193. metadata +23 -5
  194. data/.github/workflows/valgrind.yml +0 -42
data/core/marshal.rbs CHANGED
@@ -167,9 +167,9 @@ module Marshal
167
167
  # Never pass untrusted data (including user supplied input) to this method.
168
168
  # Please see the overview for further details.
169
169
  #
170
- # If the `freeze: true` argument is passed, deserialized object would be deeply
171
- # frozen. Note that it may lead to more efficient memory usage due to frozen
172
- # strings deduplication:
170
+ # If the <code>freeze: true</code> argument is passed, deserialized object would
171
+ # be deeply frozen. Note that it may lead to more efficient memory usage due to
172
+ # frozen strings deduplication:
173
173
  #
174
174
  # serialized = Marshal.dump(['value1', 'value2', 'value1', 'value2'])
175
175
  #
data/core/match_data.rbs CHANGED
@@ -34,12 +34,14 @@
34
34
  # Parts of last MatchData (returned by Regexp.last_match) are also aliased as
35
35
  # global variables:
36
36
  #
37
- # * `$~` is Regexp.last_match;
38
- # * `$&` is Regexp.last_match`[ 0 ]`;
39
- # * `$1`, `$2`, and so on are Regexp.last_match`[ i ]` (captures by number);
40
- # * `$`` is Regexp.last_match`.pre_match`;
41
- # * `$'` is Regexp.last_match`.post_match`;
42
- # * `$+` is Regexp.last_match`[ -1 ]` (the last capture).
37
+ # * <code>$~</code> is Regexp.last_match;
38
+ # * <code>$&</code> is Regexp.last_match<code>[ 0 ]</code>;
39
+ # * <code>$1</code>, <code>$2</code>, and so on are Regexp.last_match<code>[ i
40
+ # ]</code> (captures by number);
41
+ # * <code>$`</code> is Regexp.last_match<code>.pre_match</code>;
42
+ # * <code>$'</code> is Regexp.last_match<code>.post_match</code>;
43
+ # * <code>$+</code> is Regexp.last_match<code>[ -1 ]</code> (the last
44
+ # capture).
43
45
  #
44
46
  # See also Regexp@Global+Variables.
45
47
  #
@@ -230,7 +232,7 @@ class MatchData
230
232
  # rdoc-file=re.c
231
233
  # - captures -> array
232
234
  # -->
233
- # Returns the array of captures, which are all matches except `m[0]`:
235
+ # Returns the array of captures, which are all matches except <code>m[0]</code>:
234
236
  #
235
237
  # m = /(.)(.)(\d+)(\d)/.match("THX1138.")
236
238
  # # => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
@@ -242,7 +244,7 @@ class MatchData
242
244
  def captures: () -> Array[String?]
243
245
 
244
246
  # <!-- rdoc-file=re.c -->
245
- # Returns the array of captures, which are all matches except `m[0]`:
247
+ # Returns the array of captures, which are all matches except <code>m[0]</code>:
246
248
  #
247
249
  # m = /(.)(.)(\d+)(\d)/.match("THX1138.")
248
250
  # # => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
@@ -511,8 +513,8 @@ class MatchData
511
513
  # - post_match -> str
512
514
  # -->
513
515
  # Returns the substring of the target string from the end of the first match in
514
- # `self` (that is, `self[0]`) to the end of the string; equivalent to regexp
515
- # global variable `$'`:
516
+ # `self` (that is, <code>self[0]</code>) to the end of the string; equivalent to
517
+ # regexp global variable <code>$'</code>:
516
518
  #
517
519
  # m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
518
520
  # # => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
@@ -528,8 +530,8 @@ class MatchData
528
530
  # - pre_match -> string
529
531
  # -->
530
532
  # Returns the substring of the target string from its beginning up to the first
531
- # match in `self` (that is, `self[0]`); equivalent to regexp global variable
532
- # `$``:
533
+ # match in `self` (that is, <code>self[0]</code>); equivalent to regexp global
534
+ # variable <code>$`</code>:
533
535
  #
534
536
  # m = /(.)(.)(\d+)(\d)/.match("THX1138.")
535
537
  # # => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
data/core/math.rbs CHANGED
@@ -41,8 +41,8 @@
41
41
  # because many such values are, in mathematics, of infinite precision, while in
42
42
  # numerical computation the precision is finite.
43
43
  #
44
- # Thus, in mathematics, *cos(π/2)* is exactly zero, but in our computation
45
- # `cos(PI/2)` is a number very close to zero:
44
+ # Thus, in mathematics, <em>cos(π/2)</em> is exactly zero, but in our
45
+ # computation <code>cos(PI/2)</code> is a number very close to zero:
46
46
  #
47
47
  # cos(PI/2) # => 6.123031769111886e-17
48
48
  #
@@ -114,7 +114,7 @@
114
114
  #
115
115
  # #### Hypotenuse Function
116
116
  #
117
- # * ::hypot: Returns `sqrt(a**2 + b**2)` for the given `a` and `b`.
117
+ # * ::hypot: Returns <code>sqrt(a**2 + b**2)</code> for the given `a` and `b`.
118
118
  #
119
119
  module Math
120
120
  # <!-- rdoc-file=math.c -->
@@ -137,7 +137,7 @@ module Math
137
137
  #
138
138
  # Math.acos(42)
139
139
  #
140
- # *produces:*
140
+ # <em>produces:</em>
141
141
  #
142
142
  # Math::DomainError: Numerical argument is out of domain - "acos"
143
143
  #
@@ -155,8 +155,8 @@ module Math
155
155
  # Returns the [arc
156
156
  # cosine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of `x`.
157
157
  #
158
- # * Domain: `[-1, 1]`.
159
- # * Range: `[0, PI]`.
158
+ # * Domain: <code>[-1, 1]</code>.
159
+ # * Range: <code>[0, PI]</code>.
160
160
  #
161
161
  # Examples:
162
162
  #
@@ -173,8 +173,8 @@ module Math
173
173
  # Returns the [inverse hyperbolic
174
174
  # cosine](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions) of `x`.
175
175
  #
176
- # * Domain: `[1, INFINITY]`.
177
- # * Range: `[0, INFINITY]`.
176
+ # * Domain: <code>[1, INFINITY]</code>.
177
+ # * Range: <code>[0, INFINITY]</code>.
178
178
  #
179
179
  # Examples:
180
180
  #
@@ -190,8 +190,8 @@ module Math
190
190
  # Returns the [arc
191
191
  # sine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of `x`.
192
192
  #
193
- # * Domain: `[-1, -1]`.
194
- # * Range: `[-PI/2, PI/2]`.
193
+ # * Domain: <code>[-1, -1]</code>.
194
+ # * Range: <code>[-PI/2, PI/2]</code>.
195
195
  #
196
196
  # Examples:
197
197
  #
@@ -208,8 +208,8 @@ module Math
208
208
  # Returns the [inverse hyperbolic
209
209
  # sine](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions) of `x`.
210
210
  #
211
- # * Domain: `[-INFINITY, INFINITY]`.
212
- # * Range: `[-INFINITY, INFINITY]`.
211
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
212
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
213
213
  #
214
214
  # Examples:
215
215
  #
@@ -227,8 +227,8 @@ module Math
227
227
  # tangent](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of
228
228
  # `x`.
229
229
  #
230
- # * Domain: `[-INFINITY, INFINITY]`.
231
- # * Range: `[-PI/2, PI/2] `.
230
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
231
+ # * Range: <code>[-PI/2, PI/2] </code>.
232
232
  #
233
233
  # Examples:
234
234
  #
@@ -251,9 +251,9 @@ module Math
251
251
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
252
252
  # _degrees).
253
253
  #
254
- # * Domain of `y`: `[-INFINITY, INFINITY]`.
255
- # * Domain of `x`: `[-INFINITY, INFINITY]`.
256
- # * Range: `[-PI, PI]`.
254
+ # * Domain of `y`: <code>[-INFINITY, INFINITY]</code>.
255
+ # * Domain of `x`: <code>[-INFINITY, INFINITY]</code>.
256
+ # * Range: <code>[-PI, PI]</code>.
257
257
  #
258
258
  # Examples:
259
259
  #
@@ -271,8 +271,8 @@ module Math
271
271
  # Returns the [inverse hyperbolic
272
272
  # tangent](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions) of `x`.
273
273
  #
274
- # * Domain: `[-1, 1]`.
275
- # * Range: `[-INFINITY, INFINITY]`.
274
+ # * Domain: <code>[-1, 1]</code>.
275
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
276
276
  #
277
277
  # Examples:
278
278
  #
@@ -288,8 +288,8 @@ module Math
288
288
  # -->
289
289
  # Returns the [cube root](https://en.wikipedia.org/wiki/Cube_root) of `x`.
290
290
  #
291
- # * Domain: `[-INFINITY, INFINITY]`.
292
- # * Range: `[-INFINITY, INFINITY]`.
291
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
292
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
293
293
  #
294
294
  # Examples:
295
295
  #
@@ -315,8 +315,8 @@ module Math
315
315
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
316
316
  # _degrees).
317
317
  #
318
- # * Domain: `(-INFINITY, INFINITY)`.
319
- # * Range: `[-1.0, 1.0]`.
318
+ # * Domain: <code>(-INFINITY, INFINITY)</code>.
319
+ # * Range: <code>[-1.0, 1.0]</code>.
320
320
  #
321
321
  # Examples:
322
322
  #
@@ -337,8 +337,8 @@ module Math
337
337
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
338
338
  # _degrees).
339
339
  #
340
- # * Domain: `[-INFINITY, INFINITY]`.
341
- # * Range: `[1, INFINITY]`.
340
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
341
+ # * Range: <code>[1, INFINITY]</code>.
342
342
  #
343
343
  # Examples:
344
344
  #
@@ -355,8 +355,8 @@ module Math
355
355
  # Returns the value of the [Gauss error
356
356
  # function](https://en.wikipedia.org/wiki/Error_function) for `x`.
357
357
  #
358
- # * Domain: `[-INFINITY, INFINITY]`.
359
- # * Range: `[-1, 1]`.
358
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
359
+ # * Range: <code>[-1, 1]</code>.
360
360
  #
361
361
  # Examples:
362
362
  #
@@ -376,8 +376,8 @@ module Math
376
376
  # function](https://en.wikipedia.org/wiki/Error_function#Complementary_error_fun
377
377
  # ction) for `x`.
378
378
  #
379
- # * Domain: `[-INFINITY, INFINITY]`.
380
- # * Range: `[0, 2]`.
379
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
380
+ # * Range: <code>[0, 2]</code>.
381
381
  #
382
382
  # Examples:
383
383
  #
@@ -395,8 +395,8 @@ module Math
395
395
  # -->
396
396
  # Returns `e` raised to the `x` power.
397
397
  #
398
- # * Domain: `[-INFINITY, INFINITY]`.
399
- # * Range: `[0, INFINITY]`.
398
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
399
+ # * Range: <code>[0, INFINITY]</code>.
400
400
  #
401
401
  # Examples:
402
402
  #
@@ -416,8 +416,8 @@ module Math
416
416
  # -->
417
417
  # Returns "exp(x) - 1", `e` raised to the `x` power, minus 1.
418
418
  #
419
- # * Domain: `[-INFINITY, INFINITY]`.
420
- # * Range: `[-1.0, INFINITY]`.
419
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
420
+ # * Range: <code>[-1.0, INFINITY]</code>.
421
421
  #
422
422
  # Examples:
423
423
  #
@@ -444,8 +444,8 @@ module Math
444
444
  # binary64](https://en.wikipedia.org/wiki/Double-precision_floating-point_format
445
445
  # #IEEE_754_double-precision_binary_floating-point_format:_binary64).
446
446
  #
447
- # * Domain: `[-INFINITY, INFINITY]`.
448
- # * Range `[-INFINITY, INFINITY]`.
447
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
448
+ # * Range <code>[-INFINITY, INFINITY]</code>.
449
449
  #
450
450
  # Examples:
451
451
  #
@@ -468,8 +468,8 @@ module Math
468
468
  # Returns the value of the [gamma
469
469
  # function](https://en.wikipedia.org/wiki/Gamma_function) for `x`.
470
470
  #
471
- # * Domain: `(-INFINITY, INFINITY]` excluding negative integers.
472
- # * Range: `[-INFINITY, INFINITY]`.
471
+ # * Domain: <code>(-INFINITY, INFINITY]</code> excluding negative integers.
472
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
473
473
  #
474
474
  # Examples:
475
475
  #
@@ -491,12 +491,13 @@ module Math
491
491
  # rdoc-file=math.c
492
492
  # - Math.hypot(a, b) -> float
493
493
  # -->
494
- # Returns `sqrt(a**2 + b**2)`, which is the length of the longest side `c` (the
495
- # hypotenuse) of the right triangle whose other sides have lengths `a` and `b`.
494
+ # Returns <code>sqrt(a**2 + b**2)</code>, which is the length of the longest
495
+ # side `c` (the hypotenuse) of the right triangle whose other sides have lengths
496
+ # `a` and `b`.
496
497
  #
497
- # * Domain of `a`: `[-INFINITY, INFINITY]`.
498
- # * Domain of +ab: `[-INFINITY, INFINITY]`.
499
- # * Range: `[0, INFINITY]`.
498
+ # * Domain of `a`: <code>[-INFINITY, INFINITY]</code>.
499
+ # * Domain of +ab: <code>[-INFINITY, INFINITY]</code>.
500
+ # * Range: <code>[0, INFINITY]</code>.
500
501
  #
501
502
  # Examples:
502
503
  #
@@ -506,8 +507,8 @@ module Math
506
507
  # hypot(5.0, 12.0) # => 13.0
507
508
  # hypot(1.0, sqrt(3.0)) # => 1.9999999999999998 # Near 2.0
508
509
  #
509
- # Note that if either argument is `INFINITY` or `-INFINITY`, the result is
510
- # `Infinity`.
510
+ # Note that if either argument is `INFINITY` or <code>-INFINITY</code>, the
511
+ # result is `Infinity`.
511
512
  #
512
513
  def self.hypot: (double x, double y) -> Float
513
514
 
@@ -515,10 +516,11 @@ module Math
515
516
  # rdoc-file=math.c
516
517
  # - Math.ldexp(fraction, exponent) -> float
517
518
  # -->
518
- # Returns the value of `fraction * 2**exponent`.
519
+ # Returns the value of <code>fraction * 2**exponent</code>.
519
520
  #
520
- # * Domain of `fraction`: `[0.0, 1.0)`.
521
- # * Domain of `exponent`: `[0, 1024]` (larger values are equivalent to 1024).
521
+ # * Domain of `fraction`: <code>[0.0, 1.0)</code>.
522
+ # * Domain of `exponent`: <code>[0, 1024]</code> (larger values are equivalent
523
+ # to 1024).
522
524
  #
523
525
  # See [IEEE 754 double-precision binary floating-point format:
524
526
  # binary64](https://en.wikipedia.org/wiki/Double-precision_floating-point_format
@@ -549,8 +551,8 @@ module Math
549
551
  # See [log gamma
550
552
  # function](https://en.wikipedia.org/wiki/Gamma_function#Log-gamma_function).
551
553
  #
552
- # * Domain: `(-INFINITY, INFINITY]`.
553
- # * Range of first element: `(-INFINITY, INFINITY]`.
554
+ # * Domain: <code>(-INFINITY, INFINITY]</code>.
555
+ # * Range of first element: <code>(-INFINITY, INFINITY]</code>.
554
556
  # * Second element is -1 or 1.
555
557
  #
556
558
  # Examples:
@@ -584,8 +586,8 @@ module Math
584
586
  # Returns the base `base` [logarithm](https://en.wikipedia.org/wiki/Logarithm)
585
587
  # of `x`.
586
588
  #
587
- # * Domain: `[0, INFINITY]`.
588
- # * Range: `[-INFINITY, INFINITY)]`.
589
+ # * Domain: <code>[0, INFINITY]</code>.
590
+ # * Range: <code>[-INFINITY, INFINITY)]</code>.
589
591
  #
590
592
  # Examples:
591
593
  #
@@ -611,8 +613,8 @@ module Math
611
613
  # Returns the base 10 [logarithm](https://en.wikipedia.org/wiki/Logarithm) of
612
614
  # `x`.
613
615
  #
614
- # * Domain: `[0, INFINITY]`.
615
- # * Range: `[-INFINITY, INFINITY]`.
616
+ # * Domain: <code>[0, INFINITY]</code>.
617
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
616
618
  #
617
619
  # Examples:
618
620
  #
@@ -630,8 +632,8 @@ module Math
630
632
  # Returns "log(x + 1)", the base E
631
633
  # [logarithm](https://en.wikipedia.org/wiki/Logarithm) of (`x` + 1).
632
634
  #
633
- # * Domain: `[-1, INFINITY]`.
634
- # * Range: `[-INFINITY, INFINITY]`.
635
+ # * Domain: <code>[-1, INFINITY]</code>.
636
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
635
637
  #
636
638
  # Examples:
637
639
  #
@@ -649,8 +651,8 @@ module Math
649
651
  # Returns the base 2 [logarithm](https://en.wikipedia.org/wiki/Logarithm) of
650
652
  # `x`.
651
653
  #
652
- # * Domain: `[0, INFINITY]`.
653
- # * Range: `[-INFINITY, INFINITY]`.
654
+ # * Domain: <code>[0, INFINITY]</code>.
655
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
654
656
  #
655
657
  # Examples:
656
658
  #
@@ -669,8 +671,8 @@ module Math
669
671
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
670
672
  # _degrees).
671
673
  #
672
- # * Domain: `(-INFINITY, INFINITY)`.
673
- # * Range: `[-1.0, 1.0]`.
674
+ # * Domain: <code>(-INFINITY, INFINITY)</code>.
675
+ # * Range: <code>[-1.0, 1.0]</code>.
674
676
  #
675
677
  # Examples:
676
678
  #
@@ -691,8 +693,8 @@ module Math
691
693
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
692
694
  # _degrees).
693
695
  #
694
- # * Domain: `[-INFINITY, INFINITY]`.
695
- # * Range: `[-INFINITY, INFINITY]`.
696
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
697
+ # * Range: <code>[-INFINITY, INFINITY]</code>.
696
698
  #
697
699
  # Examples:
698
700
  #
@@ -709,8 +711,8 @@ module Math
709
711
  # Returns the principal (non-negative) [square
710
712
  # root](https://en.wikipedia.org/wiki/Square_root) of `x`.
711
713
  #
712
- # * Domain: `[0, INFINITY]`.
713
- # * Range: `[0, INFINITY]`.
714
+ # * Domain: <code>[0, INFINITY]</code>.
715
+ # * Range: <code>[0, INFINITY]</code>.
714
716
  #
715
717
  # Examples:
716
718
  #
@@ -733,8 +735,8 @@ module Math
733
735
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
734
736
  # _degrees).
735
737
  #
736
- # * Domain: `(-INFINITY, INFINITY)`.
737
- # * Range: `(-INFINITY, INFINITY)`.
738
+ # * Domain: <code>(-INFINITY, INFINITY)</code>.
739
+ # * Range: <code>(-INFINITY, INFINITY)</code>.
738
740
  #
739
741
  # Examples:
740
742
  #
@@ -755,8 +757,8 @@ module Math
755
757
  # [radians](https://en.wikipedia.org/wiki/Trigonometric_functions#Radians_versus
756
758
  # _degrees).
757
759
  #
758
- # * Domain: `[-INFINITY, INFINITY]`.
759
- # * Range: `[-1, 1]`.
760
+ # * Domain: <code>[-INFINITY, INFINITY]</code>.
761
+ # * Range: <code>[-1, 1]</code>.
760
762
  #
761
763
  # Examples:
762
764
  #
data/core/method.rbs CHANGED
@@ -74,12 +74,12 @@ class Method
74
74
  # Net::HTTP.method(:get).inspect
75
75
  # #=> "#<Method: Net::HTTP.get(uri_or_host, path=..., port=...) <skip>/lib/ruby/2.7.0/net/http.rb:457>"
76
76
  #
77
- # `...` in argument definition means argument is optional (has some default
78
- # value).
77
+ # <code>...</code> in argument definition means argument is optional (has some
78
+ # default value).
79
79
  #
80
80
  # For methods defined in C (language core and extensions), location and argument
81
81
  # names can't be extracted, and only generic information is provided in form of
82
- # `*` (any number of arguments) or `_` (some positional argument).
82
+ # <code>*</code> (any number of arguments) or `_` (some positional argument).
83
83
  #
84
84
  # "cat".method(:count).inspect #=> "#<Method: String#count(*)>"
85
85
  # "cat".method(:+).inspect #=> "#<Method: String#+(_)>""
@@ -102,12 +102,12 @@ class Method
102
102
  # Net::HTTP.method(:get).inspect
103
103
  # #=> "#<Method: Net::HTTP.get(uri_or_host, path=..., port=...) <skip>/lib/ruby/2.7.0/net/http.rb:457>"
104
104
  #
105
- # `...` in argument definition means argument is optional (has some default
106
- # value).
105
+ # <code>...</code> in argument definition means argument is optional (has some
106
+ # default value).
107
107
  #
108
108
  # For methods defined in C (language core and extensions), location and argument
109
109
  # names can't be extracted, and only generic information is provided in form of
110
- # `*` (any number of arguments) or `_` (some positional argument).
110
+ # <code>*</code> (any number of arguments) or `_` (some positional argument).
111
111
  #
112
112
  # "cat".method(:count).inspect #=> "#<Method: String#count(*)>"
113
113
  # "cat".method(:+).inspect #=> "#<Method: String#+(_)>""