rbs 3.6.1 → 3.7.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +4 -2
- data/.github/workflows/windows.yml +5 -3
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +47 -0
- data/Rakefile +34 -1
- data/config.yml +311 -0
- data/core/dir.rbs +1 -1
- data/core/io.rbs +2 -2
- data/core/kernel.rbs +3 -3
- data/core/process.rbs +1 -1
- data/core/set.rbs +1 -1
- data/docs/syntax.md +6 -4
- data/ext/rbs_extension/extconf.rb +10 -0
- data/ext/rbs_extension/parser.c +104 -111
- data/ext/rbs_extension/rbs_extension.h +1 -10
- data/{ext/rbs_extension → include/rbs}/constants.h +21 -19
- data/include/rbs/ruby_objs.h +72 -0
- data/include/rbs.h +7 -0
- data/lib/rbs/collection/config/lockfile_generator.rb +34 -5
- data/lib/rbs/collection/config.rb +2 -2
- data/lib/rbs/definition.rb +10 -8
- data/lib/rbs/definition_builder.rb +6 -3
- data/lib/rbs/environment_loader.rb +5 -0
- data/lib/rbs/prototype/rb.rb +7 -3
- data/lib/rbs/test/hook.rb +45 -40
- data/lib/rbs/types.rb +16 -3
- data/lib/rbs/version.rb +1 -1
- data/rbs.gemspec +1 -1
- data/sig/ancestor_graph.rbs +1 -1
- data/sig/collection/config/lockfile_generator.rbs +9 -1
- data/sig/definition.rbs +20 -5
- data/sig/definition_builder.rbs +1 -1
- data/sig/environment.rbs +1 -1
- data/sig/prototype/rb.rbs +1 -1
- data/sig/type_alias_dependency.rbs +2 -2
- data/sig/type_alias_regularity.rbs +1 -1
- data/sig/type_param.rbs +3 -3
- data/sig/vendorer.rbs +1 -1
- data/{ext/rbs_extension → src}/constants.c +35 -36
- data/src/ruby_objs.c +793 -0
- data/stdlib/cgi/0/core.rbs +3 -3
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/csv/0/manifest.yaml +1 -0
- data/stdlib/did_you_mean/0/did_you_mean.rbs +1 -1
- data/stdlib/json/0/json.rbs +1 -1
- data/stdlib/minitest/0/kernel.rbs +2 -2
- data/stdlib/minitest/0/minitest/abstract_reporter.rbs +4 -1
- data/stdlib/minitest/0/minitest/assertion.rbs +1 -0
- data/stdlib/minitest/0/minitest/assertions.rbs +58 -13
- data/stdlib/minitest/0/minitest/backtrace_filter.rbs +7 -0
- data/stdlib/minitest/0/minitest/bench_spec.rbs +8 -8
- data/stdlib/minitest/0/minitest/benchmark.rbs +17 -16
- data/stdlib/minitest/0/minitest/compress.rbs +13 -0
- data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
- data/stdlib/minitest/0/minitest/mock.rbs +9 -5
- data/stdlib/minitest/0/minitest/parallel/executor.rbs +4 -0
- data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +0 -1
- data/stdlib/minitest/0/minitest/pride_io.rbs +8 -0
- data/stdlib/minitest/0/minitest/pride_lol.rbs +2 -0
- data/stdlib/minitest/0/minitest/progress_reporter.rbs +1 -1
- data/stdlib/minitest/0/minitest/reportable.rbs +2 -0
- data/stdlib/minitest/0/minitest/runnable.rbs +33 -1
- data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +1 -1
- data/stdlib/minitest/0/minitest/spec/dsl.rbs +10 -6
- data/stdlib/minitest/0/minitest/spec.rbs +1 -1
- data/stdlib/minitest/0/minitest/statistics_reporter.rbs +5 -0
- data/stdlib/minitest/0/minitest/summary_reporter.rbs +0 -7
- data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +1 -1
- data/stdlib/minitest/0/minitest/test.rbs +7 -14
- data/stdlib/minitest/0/minitest/unexpected_error.rbs +2 -0
- data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
- data/stdlib/minitest/0/minitest/unit.rbs +1 -2
- data/stdlib/minitest/0/minitest.rbs +41 -892
- data/stdlib/open-uri/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/openssl.rbs +26 -1
- data/stdlib/psych/0/core_ext.rbs +12 -0
- data/templates/include/rbs/constants.h.erb +20 -0
- data/templates/include/rbs/ruby_objs.h.erb +10 -0
- data/templates/src/constants.c.erb +36 -0
- data/templates/src/ruby_objs.c.erb +27 -0
- data/templates/template.rb +122 -0
- metadata +19 -9
- data/ext/rbs_extension/ruby_objs.c +0 -602
- data/ext/rbs_extension/ruby_objs.h +0 -51
- data/stdlib/minitest/0/manifest.yaml +0 -2
- /data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71d2f47af53cec9b87afca94ed1f79caf43e91caed557a454d6cd1532252dac1
|
4
|
+
data.tar.gz: a5e0d3a9e65aad57295754716a9d9f2d99d0a841ed930fa6b2b5a991151fdab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29487fc82d44333d8c63e910c26a9d3454e5d0e8e6c5d7951e25bf87e2ab2d4c8d444e53b81098da3b0b7080f3d3d80cde92132494a0422ee4d18bd04c915249
|
7
|
+
data.tar.gz: ba2e2a81be7d83bb31f6e1e58824ca9eea51c29bff4fbf54eddb93245b258118265f31c2f2753e68e3d9639dd242083311252037c15c3dc17f88d1f09a92518b
|
data/.github/workflows/ruby.yml
CHANGED
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby: ['3.
|
16
|
+
ruby: ['3.1', '3.2', '3.3', head]
|
17
17
|
rubyopt: [""]
|
18
18
|
job:
|
19
19
|
- test
|
@@ -29,11 +29,13 @@ jobs:
|
|
29
29
|
job: stdlib_test
|
30
30
|
rubyopt: "--enable-frozen-string-literal"
|
31
31
|
- ruby: "3.3"
|
32
|
-
job: lexer compile confirm_lexer
|
32
|
+
job: lexer templates compile confirm_lexer confirm_templates
|
33
33
|
- ruby: "3.3"
|
34
34
|
job: rubocop validate test_doc build test_generate_stdlib raap
|
35
35
|
- ruby: "3.3"
|
36
36
|
job: typecheck_test
|
37
|
+
env:
|
38
|
+
RANDOMIZE_STDLIB_TEST_ORDER: "true"
|
37
39
|
steps:
|
38
40
|
- uses: actions/checkout@v4
|
39
41
|
- uses: ruby/setup-ruby@v1
|
@@ -20,7 +20,9 @@ jobs:
|
|
20
20
|
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
22
22
|
ruby-version: ${{ matrix.ruby }}
|
23
|
-
- name:
|
24
|
-
run:
|
23
|
+
- name: bundle install
|
24
|
+
run: |
|
25
|
+
bundle config set without profilers libs
|
26
|
+
bundle install
|
25
27
|
- name: compile
|
26
|
-
run: rake compile
|
28
|
+
run: bundle exec rake compile
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -28,11 +28,17 @@ RBS/Lint:
|
|
28
28
|
Exclude:
|
29
29
|
- 'sig/**/*'
|
30
30
|
- 'test/**/*'
|
31
|
+
RBS/Lint/TopLevelInterface:
|
32
|
+
Enabled: false
|
33
|
+
RBS/Lint/TopLevelTypeAlias:
|
34
|
+
Enabled: false
|
31
35
|
RBS/Style:
|
32
36
|
Enabled: false
|
33
37
|
Exclude:
|
34
38
|
- 'sig/**/*'
|
35
39
|
- 'test/**/*'
|
40
|
+
RBS/Style/EmptyArgument:
|
41
|
+
Enabled: true
|
36
42
|
RBS/Style/InitializeReturnType:
|
37
43
|
Enabled: true
|
38
44
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,52 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 3.7.0.pre.1 (2024-12-05)
|
4
|
+
|
5
|
+
### Signature updates
|
6
|
+
|
7
|
+
* `CGI.accept_charset` ([#2045](https://github.com/ruby/rbs/pull/2045))
|
8
|
+
* `IO#readline`, `IO#readlines` ([#2059](https://github.com/ruby/rbs/pull/2059))
|
9
|
+
* `Kernel#proc` ([#2036](https://github.com/ruby/rbs/pull/2036))
|
10
|
+
* `Kernel#system` ([#2075](https://github.com/ruby/rbs/pull/2075))
|
11
|
+
* `Object#to_yaml` ([#2107](https://github.com/ruby/rbs/pull/2107))
|
12
|
+
* `OpenSSL::Digest` ([#2108](https://github.com/ruby/rbs/pull/2108))
|
13
|
+
* `OpenSSL.base64digest` ([#2078](https://github.com/ruby/rbs/pull/2078))
|
14
|
+
* `Process.detach` ([#2083](https://github.com/ruby/rbs/pull/2083))
|
15
|
+
|
16
|
+
### Library changes
|
17
|
+
|
18
|
+
* Reduce object allocation for record type ([#2118](https://github.com/ruby/rbs/pull/2118))
|
19
|
+
* Milestone to graduate stringio from core. ([#2114](https://github.com/ruby/rbs/pull/2114))
|
20
|
+
* Mark all internal `parse_` methods as `static` ([#2103](https://github.com/ruby/rbs/pull/2103))
|
21
|
+
* Add templating mechanism to automatically generate `.c`/`.h` files ([#2098](https://github.com/ruby/rbs/pull/2098))
|
22
|
+
* Remove unused `rbs_unescape_string` declaration ([#2058](https://github.com/ruby/rbs/pull/2058))
|
23
|
+
* Fix UntypedFunction does not provide #map_type_name ([#2054](https://github.com/ruby/rbs/pull/2054))
|
24
|
+
* Better `instance_eval`/`instance_exec` detection ([#2052](https://github.com/ruby/rbs/pull/2052))
|
25
|
+
* Overload annotations ([#2049](https://github.com/ruby/rbs/pull/2049))
|
26
|
+
|
27
|
+
#### rbs prototype
|
28
|
+
|
29
|
+
* prototype rb: Fix crashed by self::CONST ([#2079](https://github.com/ruby/rbs/pull/2079))
|
30
|
+
|
31
|
+
#### rbs collection
|
32
|
+
|
33
|
+
* mutex_m support ([#2115](https://github.com/ruby/rbs/pull/2115))
|
34
|
+
|
35
|
+
### Miscellaneous
|
36
|
+
|
37
|
+
* Use `File.open` with block ([#2119](https://github.com/ruby/rbs/pull/2119))
|
38
|
+
* Compile without activesupport ([#2105](https://github.com/ruby/rbs/pull/2105))
|
39
|
+
* docs: Add singleton attribute members to syntax.md ([#2090](https://github.com/ruby/rbs/pull/2090))
|
40
|
+
* Bundle update rubocop-on-rbs ([#2094](https://github.com/ruby/rbs/pull/2094))
|
41
|
+
* `bundle exec` on windows ([#2101](https://github.com/ruby/rbs/pull/2101))
|
42
|
+
* Fix typos ([#2097](https://github.com/ruby/rbs/pull/2097))
|
43
|
+
* Bundle update json 2.8.2 ([#2095](https://github.com/ruby/rbs/pull/2095))
|
44
|
+
* Skip `rbs` gem validation ([#2084](https://github.com/ruby/rbs/pull/2084))
|
45
|
+
* Skip PTY_test with Windows platform ([#2055](https://github.com/ruby/rbs/pull/2055))
|
46
|
+
* Randomize stdlib test order to uncover hidden assumptions ([#2043](https://github.com/ruby/rbs/pull/2043))
|
47
|
+
* Suppress `inline` is not at beginning of declaration for melt_array ([#2050](https://github.com/ruby/rbs/pull/2050))
|
48
|
+
* Skip `mkpath` test with 3.4 ([#2053](https://github.com/ruby/rbs/pull/2053))
|
49
|
+
|
3
50
|
## 3.6.1 (2024-10-03)
|
4
51
|
|
5
52
|
### Library changes
|
data/Rakefile
CHANGED
@@ -30,10 +30,22 @@ task :confirm_lexer => :lexer do
|
|
30
30
|
sh "git diff --exit-code ext/rbs_extension/lexer.c"
|
31
31
|
end
|
32
32
|
|
33
|
+
task :confirm_templates => :templates do
|
34
|
+
puts "Testing if generated code under include and src is updated with respect to templates"
|
35
|
+
sh "git diff --exit-code -- include src"
|
36
|
+
end
|
37
|
+
|
33
38
|
rule ".c" => ".re" do |t|
|
34
39
|
puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake lexer` ⚠️⚠️⚠️"
|
35
40
|
end
|
36
41
|
|
42
|
+
rule %r{^src/(.*)\.c} => 'templates/%X.c.erb' do |t|
|
43
|
+
puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake templates` ⚠️⚠️⚠️"
|
44
|
+
end
|
45
|
+
rule %r{^include/(.*)\.c} => 'templates/%X.c.erb' do |t|
|
46
|
+
puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake templates` ⚠️⚠️⚠️"
|
47
|
+
end
|
48
|
+
|
37
49
|
task :annotate do
|
38
50
|
sh "bin/generate_docs.sh"
|
39
51
|
end
|
@@ -43,7 +55,18 @@ task :confirm_annotation do
|
|
43
55
|
sh "git diff --exit-code core stdlib"
|
44
56
|
end
|
45
57
|
|
58
|
+
task :templates do
|
59
|
+
sh "#{ruby} templates/template.rb include/rbs/constants.h"
|
60
|
+
sh "#{ruby} templates/template.rb include/rbs/ruby_objs.h"
|
61
|
+
sh "#{ruby} templates/template.rb src/constants.c"
|
62
|
+
sh "#{ruby} templates/template.rb src/ruby_objs.c"
|
63
|
+
end
|
64
|
+
|
46
65
|
task :compile => "ext/rbs_extension/lexer.c"
|
66
|
+
task :compile => "include/rbs/constants.h"
|
67
|
+
task :compile => "include/rbs/ruby_objs.h"
|
68
|
+
task :compile => "src/constants.c"
|
69
|
+
task :compile => "src/ruby_objs.c"
|
47
70
|
|
48
71
|
task :test_doc do
|
49
72
|
files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
@@ -63,7 +86,12 @@ task :validate => :compile do
|
|
63
86
|
# Skip RBS validation because Ruby CI runs without rubygems
|
64
87
|
case skip_rbs_validation = ENV["SKIP_RBS_VALIDATION"]
|
65
88
|
when nil
|
66
|
-
|
89
|
+
begin
|
90
|
+
Gem::Specification.find_by_name("rbs")
|
91
|
+
libs << "rbs"
|
92
|
+
rescue Gem::MissingSpecError
|
93
|
+
STDERR.puts "🚨🚨🚨🚨 Skipping `rbs` gem because it's not found"
|
94
|
+
end
|
67
95
|
when "true"
|
68
96
|
# Skip
|
69
97
|
else
|
@@ -86,6 +114,11 @@ task :stdlib_test => :compile do
|
|
86
114
|
test_files = FileList["test/stdlib/**/*_test.rb"].reject do |path|
|
87
115
|
path =~ %r{Ractor} || path =~ %r{Encoding}
|
88
116
|
end
|
117
|
+
|
118
|
+
if ENV["RANDOMIZE_STDLIB_TEST_ORDER"] == "true"
|
119
|
+
test_files.shuffle!
|
120
|
+
end
|
121
|
+
|
89
122
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test_files.join(' ')}"
|
90
123
|
# TODO: Ractor tests need to be run in a separate process
|
91
124
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Ractor_test.rb"
|
data/config.yml
ADDED
@@ -0,0 +1,311 @@
|
|
1
|
+
nodes:
|
2
|
+
- name: RBS::AST::Annotation
|
3
|
+
fields:
|
4
|
+
- name: string
|
5
|
+
- name: location
|
6
|
+
- name: RBS::AST::Comment
|
7
|
+
fields:
|
8
|
+
- name: string
|
9
|
+
- name: location
|
10
|
+
- name: RBS::AST::Declarations::Class
|
11
|
+
fields:
|
12
|
+
- name: name
|
13
|
+
- name: type_params
|
14
|
+
- name: super_class
|
15
|
+
- name: members
|
16
|
+
- name: annotations
|
17
|
+
- name: location
|
18
|
+
- name: comment
|
19
|
+
- name: RBS::AST::Declarations::Class::Super
|
20
|
+
fields:
|
21
|
+
- name: name
|
22
|
+
- name: args
|
23
|
+
- name: location
|
24
|
+
- name: RBS::AST::Declarations::ClassAlias
|
25
|
+
fields:
|
26
|
+
- name: new_name
|
27
|
+
- name: old_name
|
28
|
+
- name: location
|
29
|
+
- name: comment
|
30
|
+
- name: RBS::AST::Declarations::Constant
|
31
|
+
fields:
|
32
|
+
- name: name
|
33
|
+
- name: type
|
34
|
+
- name: location
|
35
|
+
- name: comment
|
36
|
+
- name: RBS::AST::Declarations::Global
|
37
|
+
fields:
|
38
|
+
- name: name
|
39
|
+
- name: type
|
40
|
+
- name: location
|
41
|
+
- name: comment
|
42
|
+
- name: RBS::AST::Declarations::Interface
|
43
|
+
fields:
|
44
|
+
- name: name
|
45
|
+
- name: type_params
|
46
|
+
- name: members
|
47
|
+
- name: annotations
|
48
|
+
- name: location
|
49
|
+
- name: comment
|
50
|
+
- name: RBS::AST::Declarations::Module
|
51
|
+
fields:
|
52
|
+
- name: name
|
53
|
+
- name: type_params
|
54
|
+
- name: self_types
|
55
|
+
- name: members
|
56
|
+
- name: annotations
|
57
|
+
- name: location
|
58
|
+
- name: comment
|
59
|
+
- name: RBS::AST::Declarations::Module::Self
|
60
|
+
fields:
|
61
|
+
- name: name
|
62
|
+
- name: args
|
63
|
+
- name: location
|
64
|
+
- name: RBS::AST::Declarations::ModuleAlias
|
65
|
+
fields:
|
66
|
+
- name: new_name
|
67
|
+
- name: old_name
|
68
|
+
- name: location
|
69
|
+
- name: comment
|
70
|
+
- name: RBS::AST::Declarations::TypeAlias
|
71
|
+
fields:
|
72
|
+
- name: name
|
73
|
+
- name: type_params
|
74
|
+
- name: type
|
75
|
+
- name: annotations
|
76
|
+
- name: location
|
77
|
+
- name: comment
|
78
|
+
- name: RBS::AST::Directives::Use
|
79
|
+
fields:
|
80
|
+
- name: clauses
|
81
|
+
- name: location
|
82
|
+
- name: RBS::AST::Directives::Use::SingleClause
|
83
|
+
fields:
|
84
|
+
- name: type_name
|
85
|
+
- name: new_name
|
86
|
+
- name: location
|
87
|
+
- name: RBS::AST::Directives::Use::WildcardClause
|
88
|
+
fields:
|
89
|
+
- name: namespace
|
90
|
+
- name: location
|
91
|
+
- name: RBS::AST::Members::Alias
|
92
|
+
fields:
|
93
|
+
- name: new_name
|
94
|
+
- name: old_name
|
95
|
+
- name: kind
|
96
|
+
- name: annotations
|
97
|
+
- name: location
|
98
|
+
- name: comment
|
99
|
+
- name: RBS::AST::Members::AttrAccessor
|
100
|
+
fields:
|
101
|
+
- name: name
|
102
|
+
- name: type
|
103
|
+
- name: ivar_name
|
104
|
+
- name: kind
|
105
|
+
- name: annotations
|
106
|
+
- name: location
|
107
|
+
- name: comment
|
108
|
+
- name: visibility
|
109
|
+
- name: RBS::AST::Members::AttrReader
|
110
|
+
fields:
|
111
|
+
- name: name
|
112
|
+
- name: type
|
113
|
+
- name: ivar_name
|
114
|
+
- name: kind
|
115
|
+
- name: annotations
|
116
|
+
- name: location
|
117
|
+
- name: comment
|
118
|
+
- name: visibility
|
119
|
+
- name: RBS::AST::Members::AttrWriter
|
120
|
+
fields:
|
121
|
+
- name: name
|
122
|
+
- name: type
|
123
|
+
- name: ivar_name
|
124
|
+
- name: kind
|
125
|
+
- name: annotations
|
126
|
+
- name: location
|
127
|
+
- name: comment
|
128
|
+
- name: visibility
|
129
|
+
- name: RBS::AST::Members::ClassInstanceVariable
|
130
|
+
fields:
|
131
|
+
- name: name
|
132
|
+
- name: type
|
133
|
+
- name: location
|
134
|
+
- name: comment
|
135
|
+
- name: RBS::AST::Members::ClassVariable
|
136
|
+
fields:
|
137
|
+
- name: name
|
138
|
+
- name: type
|
139
|
+
- name: location
|
140
|
+
- name: comment
|
141
|
+
- name: RBS::AST::Members::Extend
|
142
|
+
fields:
|
143
|
+
- name: name
|
144
|
+
- name: args
|
145
|
+
- name: annotations
|
146
|
+
- name: location
|
147
|
+
- name: comment
|
148
|
+
- name: RBS::AST::Members::Include
|
149
|
+
fields:
|
150
|
+
- name: name
|
151
|
+
- name: args
|
152
|
+
- name: annotations
|
153
|
+
- name: location
|
154
|
+
- name: comment
|
155
|
+
- name: RBS::AST::Members::InstanceVariable
|
156
|
+
fields:
|
157
|
+
- name: name
|
158
|
+
- name: type
|
159
|
+
- name: location
|
160
|
+
- name: comment
|
161
|
+
- name: RBS::AST::Members::MethodDefinition
|
162
|
+
fields:
|
163
|
+
- name: name
|
164
|
+
- name: kind
|
165
|
+
- name: overloads
|
166
|
+
- name: annotations
|
167
|
+
- name: location
|
168
|
+
- name: comment
|
169
|
+
- name: overloading
|
170
|
+
- name: visibility
|
171
|
+
- name: RBS::AST::Members::MethodDefinition::Overload
|
172
|
+
fields:
|
173
|
+
- name: annotations
|
174
|
+
- name: method_type
|
175
|
+
- name: RBS::AST::Members::Prepend
|
176
|
+
fields:
|
177
|
+
- name: name
|
178
|
+
- name: args
|
179
|
+
- name: annotations
|
180
|
+
- name: location
|
181
|
+
- name: comment
|
182
|
+
- name: RBS::AST::Members::Private
|
183
|
+
fields:
|
184
|
+
- name: location
|
185
|
+
- name: RBS::AST::Members::Public
|
186
|
+
fields:
|
187
|
+
- name: location
|
188
|
+
- name: RBS::AST::TypeParam
|
189
|
+
fields:
|
190
|
+
- name: name
|
191
|
+
- name: variance
|
192
|
+
- name: upper_bound
|
193
|
+
- name: default_type
|
194
|
+
- name: location
|
195
|
+
- name: RBS::MethodType
|
196
|
+
fields:
|
197
|
+
- name: type_params
|
198
|
+
- name: type
|
199
|
+
- name: block
|
200
|
+
- name: location
|
201
|
+
- name: RBS::Namespace
|
202
|
+
fields:
|
203
|
+
- name: path
|
204
|
+
- name: absolute
|
205
|
+
- name: RBS::TypeName
|
206
|
+
fields:
|
207
|
+
- name: namespace
|
208
|
+
- name: name
|
209
|
+
- name: RBS::Types::Alias
|
210
|
+
fields:
|
211
|
+
- name: name
|
212
|
+
- name: args
|
213
|
+
- name: location
|
214
|
+
- name: RBS::Types::Bases::Any
|
215
|
+
fields:
|
216
|
+
- name: location
|
217
|
+
- name: RBS::Types::Bases::Bool
|
218
|
+
fields:
|
219
|
+
- name: location
|
220
|
+
- name: RBS::Types::Bases::Bottom
|
221
|
+
fields:
|
222
|
+
- name: location
|
223
|
+
- name: RBS::Types::Bases::Class
|
224
|
+
fields:
|
225
|
+
- name: location
|
226
|
+
- name: RBS::Types::Bases::Instance
|
227
|
+
fields:
|
228
|
+
- name: location
|
229
|
+
- name: RBS::Types::Bases::Nil
|
230
|
+
fields:
|
231
|
+
- name: location
|
232
|
+
- name: RBS::Types::Bases::Self
|
233
|
+
fields:
|
234
|
+
- name: location
|
235
|
+
- name: RBS::Types::Bases::Top
|
236
|
+
fields:
|
237
|
+
- name: location
|
238
|
+
- name: RBS::Types::Bases::Void
|
239
|
+
fields:
|
240
|
+
- name: location
|
241
|
+
- name: RBS::Types::Block
|
242
|
+
fields:
|
243
|
+
- name: type
|
244
|
+
- name: required
|
245
|
+
- name: self_type
|
246
|
+
- name: RBS::Types::ClassInstance
|
247
|
+
fields:
|
248
|
+
- name: name
|
249
|
+
- name: args
|
250
|
+
- name: location
|
251
|
+
- name: RBS::Types::ClassSingleton
|
252
|
+
fields:
|
253
|
+
- name: name
|
254
|
+
- name: location
|
255
|
+
- name: RBS::Types::Function
|
256
|
+
fields:
|
257
|
+
- name: required_positionals
|
258
|
+
- name: optional_positionals
|
259
|
+
- name: rest_positionals
|
260
|
+
- name: trailing_positionals
|
261
|
+
- name: required_keywords
|
262
|
+
- name: optional_keywords
|
263
|
+
- name: rest_keywords
|
264
|
+
- name: return_type
|
265
|
+
- name: RBS::Types::Function::Param
|
266
|
+
fields:
|
267
|
+
- name: type
|
268
|
+
- name: name
|
269
|
+
- name: location
|
270
|
+
- name: RBS::Types::Interface
|
271
|
+
fields:
|
272
|
+
- name: name
|
273
|
+
- name: args
|
274
|
+
- name: location
|
275
|
+
- name: RBS::Types::Intersection
|
276
|
+
fields:
|
277
|
+
- name: types
|
278
|
+
- name: location
|
279
|
+
- name: RBS::Types::Literal
|
280
|
+
fields:
|
281
|
+
- name: literal
|
282
|
+
- name: location
|
283
|
+
- name: RBS::Types::Optional
|
284
|
+
fields:
|
285
|
+
- name: type
|
286
|
+
- name: location
|
287
|
+
- name: RBS::Types::Proc
|
288
|
+
fields:
|
289
|
+
- name: type
|
290
|
+
- name: block
|
291
|
+
- name: location
|
292
|
+
- name: self_type
|
293
|
+
- name: RBS::Types::Record
|
294
|
+
fields:
|
295
|
+
- name: all_fields
|
296
|
+
- name: location
|
297
|
+
- name: RBS::Types::Tuple
|
298
|
+
fields:
|
299
|
+
- name: types
|
300
|
+
- name: location
|
301
|
+
- name: RBS::Types::Union
|
302
|
+
fields:
|
303
|
+
- name: types
|
304
|
+
- name: location
|
305
|
+
- name: RBS::Types::UntypedFunction
|
306
|
+
fields:
|
307
|
+
- name: return_type
|
308
|
+
- name: RBS::Types::Variable
|
309
|
+
fields:
|
310
|
+
- name: name
|
311
|
+
- name: location
|
data/core/dir.rbs
CHANGED
data/core/io.rbs
CHANGED
@@ -1638,7 +1638,7 @@ class IO < Object
|
|
1638
1638
|
# Optional keyword argument `chomp` specifies whether line separators are to be
|
1639
1639
|
# omitted.
|
1640
1640
|
#
|
1641
|
-
def readline: (?String sep, ?Integer limit) -> String
|
1641
|
+
def readline: (?String sep, ?Integer limit, ?chomp: boolish) -> String
|
1642
1642
|
|
1643
1643
|
# <!--
|
1644
1644
|
# rdoc-file=io.c
|
@@ -1701,7 +1701,7 @@ class IO < Object
|
|
1701
1701
|
# # => ["First line", "Second line", "", "Fourth line", "Fifth line"]
|
1702
1702
|
# f.close
|
1703
1703
|
#
|
1704
|
-
def readlines: (?String sep, ?Integer limit) -> ::Array[String]
|
1704
|
+
def readlines: (?String sep, ?Integer limit, ?chomp: boolish) -> ::Array[String]
|
1705
1705
|
|
1706
1706
|
# <!--
|
1707
1707
|
# rdoc-file=io.c
|
data/core/kernel.rbs
CHANGED
@@ -1209,7 +1209,7 @@ module Kernel : BasicObject
|
|
1209
1209
|
# -->
|
1210
1210
|
# Equivalent to Proc.new.
|
1211
1211
|
#
|
1212
|
-
def self?.proc: () { () -> untyped } -> Proc
|
1212
|
+
def self?.proc: () { (?) -> untyped } -> Proc
|
1213
1213
|
|
1214
1214
|
# <!--
|
1215
1215
|
# rdoc-file=proc.c
|
@@ -2056,8 +2056,8 @@ module Kernel : BasicObject
|
|
2056
2056
|
#
|
2057
2057
|
# Raises an exception if the new process could not execute.
|
2058
2058
|
#
|
2059
|
-
def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass)
|
2060
|
-
| (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass)
|
2059
|
+
def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
|
2060
|
+
| (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
|
2061
2061
|
|
2062
2062
|
# <!--
|
2063
2063
|
# rdoc-file=object.c
|
data/core/process.rbs
CHANGED
data/core/set.rbs
CHANGED
data/docs/syntax.md
CHANGED
@@ -416,10 +416,12 @@ _method-types_ ::= _method-type-parameters_ _method-type_
|
|
416
416
|
_method-type-parameters_ ::= # Empty
|
417
417
|
| `[` _type-variable_ `,` ... `]`
|
418
418
|
|
419
|
-
_attribute-member_ ::= _visibility_ _attribute-type_ _method-name_ `:` _type_
|
420
|
-
| _visibility_ _attribute-type_ _method-name_ `(` _ivar-name_ `) :` _type_
|
421
|
-
| _visibility_ _attribute-type_ _method-name_ `() :` _type_
|
422
|
-
|
419
|
+
_attribute-member_ ::= _visibility_ _attribute-type_ _method-name_ `:` _type_ # Attribute
|
420
|
+
| _visibility_ _attribute-type_ _method-name_ `(` _ivar-name_ `) :` _type_ # Attribute with variable name specification
|
421
|
+
| _visibility_ _attribute-type_ _method-name_ `() :` _type_ # Attribute without variable
|
422
|
+
| _visibility_ _attribute-type_ `self.` _method-name_ `:` _type_ # Singleton attribute
|
423
|
+
| _visibility_ _attribute-type_ `self.` _method-name_ `(` _ivar-name_ `) :` _type_ # Singleton attribute with variable name specification
|
424
|
+
| _visibility_ _attribute-type_ `self.` _method-name_ `() :` _type_ # Singleton attribute without variable
|
423
425
|
_visibility_ ::= `public` | `private`
|
424
426
|
|
425
427
|
_attribute-type_ ::= `attr_reader` | `attr_writer` | `attr_accessor`
|
@@ -1,4 +1,14 @@
|
|
1
1
|
require 'mkmf'
|
2
|
+
|
2
3
|
$INCFLAGS << " -I$(top_srcdir)" if $extmk
|
4
|
+
$INCFLAGS << " -I$(srcdir)/../../include"
|
5
|
+
|
6
|
+
$VPATH << "$(srcdir)/../../src"
|
7
|
+
$VPATH << "$(srcdir)/ext/rbs_extension"
|
8
|
+
|
9
|
+
root_dir = File.expand_path('../../../', __FILE__)
|
10
|
+
$srcs = Dir.glob("#{root_dir}/src/*.c") +
|
11
|
+
Dir.glob("#{root_dir}/ext/rbs_extension/*.c")
|
12
|
+
|
3
13
|
append_cflags ['-std=gnu99']
|
4
14
|
create_makefile 'rbs_extension'
|