rbs 3.9.4 → 4.0.0.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -1
- data/.github/workflows/typecheck.yml +2 -0
- data/.github/workflows/windows.yml +1 -1
- data/CHANGELOG.md +0 -26
- data/Rakefile +28 -21
- data/Steepfile +1 -0
- data/config.yml +232 -62
- data/ext/rbs_extension/ast_translation.c +1149 -0
- data/ext/rbs_extension/ast_translation.h +30 -0
- data/{src/constants.c → ext/rbs_extension/class_constants.c} +15 -1
- data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +10 -1
- data/ext/rbs_extension/extconf.rb +3 -1
- data/ext/rbs_extension/{location.c → legacy_location.c} +25 -34
- data/ext/rbs_extension/legacy_location.h +40 -0
- data/ext/rbs_extension/main.c +402 -8
- data/ext/rbs_extension/rbs_extension.h +3 -21
- data/ext/rbs_extension/rbs_string_bridging.c +9 -0
- data/ext/rbs_extension/rbs_string_bridging.h +20 -0
- data/include/rbs/ast.h +748 -0
- data/include/rbs/defines.h +60 -0
- data/{ext/rbs_extension → include/rbs}/lexer.h +40 -32
- data/include/rbs/location.h +59 -0
- data/include/rbs/parser.h +151 -0
- data/include/rbs/string.h +49 -0
- data/include/rbs/util/rbs_allocator.h +38 -0
- data/include/rbs/util/rbs_assert.h +9 -0
- data/include/rbs/util/rbs_buffer.h +83 -0
- data/include/rbs/util/rbs_constant_pool.h +3 -64
- data/include/rbs/util/rbs_encoding.h +280 -0
- data/include/rbs/util/rbs_unescape.h +23 -0
- data/include/rbs.h +1 -2
- data/lib/rbs/annotate/formatter.rb +3 -13
- data/lib/rbs/annotate/rdoc_annotator.rb +3 -1
- data/lib/rbs/annotate/rdoc_source.rb +1 -1
- data/lib/rbs/ast/ruby/annotations.rb +119 -0
- data/lib/rbs/ast/ruby/comment_block.rb +221 -0
- data/lib/rbs/ast/ruby/declarations.rb +86 -0
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +24 -0
- data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
- data/lib/rbs/ast/ruby/members.rb +213 -0
- data/lib/rbs/buffer.rb +104 -24
- data/lib/rbs/cli/validate.rb +39 -34
- data/lib/rbs/cli.rb +4 -5
- data/lib/rbs/definition.rb +6 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +63 -60
- data/lib/rbs/definition_builder/method_builder.rb +45 -30
- data/lib/rbs/definition_builder.rb +44 -9
- data/lib/rbs/environment/class_entry.rb +69 -0
- data/lib/rbs/environment/module_entry.rb +66 -0
- data/lib/rbs/environment.rb +185 -154
- data/lib/rbs/environment_loader.rb +2 -2
- data/lib/rbs/errors.rb +4 -3
- data/lib/rbs/inline_parser/comment_association.rb +117 -0
- data/lib/rbs/inline_parser.rb +206 -0
- data/lib/rbs/location_aux.rb +35 -3
- data/lib/rbs/parser_aux.rb +11 -1
- data/lib/rbs/prototype/runtime.rb +2 -2
- data/lib/rbs/source.rb +99 -0
- data/lib/rbs/subtractor.rb +4 -3
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +12 -0
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +2 -2
- data/rbs.gemspec +1 -0
- data/sig/ancestor_builder.rbs +1 -1
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +1 -1
- data/sig/ast/ruby/annotations.rbs +110 -0
- data/sig/ast/ruby/comment_block.rbs +119 -0
- data/sig/ast/ruby/declarations.rbs +60 -0
- data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
- data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
- data/sig/ast/ruby/members.rbs +72 -0
- data/sig/buffer.rbs +63 -5
- data/sig/definition.rbs +1 -0
- data/sig/definition_builder.rbs +1 -1
- data/sig/environment/class_entry.rbs +50 -0
- data/sig/environment/module_entry.rbs +50 -0
- data/sig/environment.rbs +22 -76
- data/sig/errors.rbs +13 -6
- data/sig/inline_parser/comment_association.rbs +71 -0
- data/sig/inline_parser.rbs +87 -0
- data/sig/location.rbs +32 -7
- data/sig/method_builder.rbs +7 -4
- data/sig/parser.rbs +16 -0
- data/sig/source.rbs +48 -0
- data/src/ast.c +1345 -0
- data/src/lexer.c +2867 -0
- data/src/lexer.re +151 -0
- data/{ext/rbs_extension → src}/lexstate.c +58 -42
- data/src/location.c +71 -0
- data/src/parser.c +3739 -0
- data/src/string.c +89 -0
- data/src/util/rbs_allocator.c +149 -0
- data/src/util/rbs_assert.c +19 -0
- data/src/util/rbs_buffer.c +54 -0
- data/src/util/rbs_constant_pool.c +13 -81
- data/src/util/rbs_encoding.c +5273 -0
- data/src/util/rbs_unescape.c +130 -0
- data/stdlib/rdoc/0/code_object.rbs +2 -2
- data/stdlib/rdoc/0/comment.rbs +2 -0
- data/stdlib/rdoc/0/options.rbs +76 -0
- data/stdlib/rdoc/0/rdoc.rbs +6 -4
- data/stdlib/rdoc/0/store.rbs +1 -1
- metadata +70 -17
- data/ext/rbs_extension/lexer.c +0 -2728
- data/ext/rbs_extension/lexer.re +0 -147
- data/ext/rbs_extension/location.h +0 -85
- data/ext/rbs_extension/parser.c +0 -2982
- data/ext/rbs_extension/parser.h +0 -18
- data/ext/rbs_extension/parserstate.c +0 -411
- data/ext/rbs_extension/parserstate.h +0 -163
- data/ext/rbs_extension/unescape.c +0 -32
- data/include/rbs/ruby_objs.h +0 -72
- data/src/ruby_objs.c +0 -799
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0f208999624a32e97044b8427ec19fa233e21a530a6383efe4ea5b9333ab1ce
|
4
|
+
data.tar.gz: d03954e5a4fa29a428085183a90a86b481849b0994e0d454cccca395412a31f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56da6e8a6a9336ae251d766b85c0d8ab62b42a8df1f1c828cd8f0c0ce898ac639a024c5b819e2e6a85733fa1d140ca5b06fc61de62b36fdb21074d34710bb003
|
7
|
+
data.tar.gz: de3ac4191be3ec60ab8bd25c4653cc2663effc2004c9d5e33d9fbb6eabace99fa883dfd5201d92c7f574d8730a74116867a853cb525343a639aeef6d0dd6d041
|
data/.github/workflows/ruby.yml
CHANGED
@@ -44,6 +44,8 @@ jobs:
|
|
44
44
|
bundler: none
|
45
45
|
- name: Set working directory as safe
|
46
46
|
run: git config --global --add safe.directory $(pwd)
|
47
|
+
- name: Set up permission
|
48
|
+
run: chmod -R o-w /opt/hostedtoolcache/Ruby
|
47
49
|
- name: Install dependencies
|
48
50
|
run: |
|
49
51
|
sudo apt-get update
|
@@ -81,13 +83,15 @@ jobs:
|
|
81
83
|
valgrind:
|
82
84
|
runs-on: ubuntu-latest
|
83
85
|
steps:
|
84
|
-
- uses: actions/checkout@
|
86
|
+
- uses: actions/checkout@v4
|
85
87
|
- uses: ruby/setup-ruby@v1
|
86
88
|
with:
|
87
89
|
ruby-version: "3.4"
|
88
90
|
bundler-cache: none
|
89
91
|
- name: Set working directory as safe
|
90
92
|
run: git config --global --add safe.directory $(pwd)
|
93
|
+
- name: Set up permission
|
94
|
+
run: chmod -R o-w /opt/hostedtoolcache/Ruby
|
91
95
|
- name: Install dependencies
|
92
96
|
run: |
|
93
97
|
sudo apt-get update
|
@@ -20,6 +20,8 @@ jobs:
|
|
20
20
|
bundler: none
|
21
21
|
- name: Set working directory as safe
|
22
22
|
run: git config --global --add safe.directory $(pwd)
|
23
|
+
- name: Set up permission
|
24
|
+
run: chmod -R o-w /opt/hostedtoolcache/Ruby
|
23
25
|
- name: Install dependencies
|
24
26
|
run: |
|
25
27
|
sudo apt-get update
|
@@ -33,7 +33,7 @@ jobs:
|
|
33
33
|
|
34
34
|
res = URI.parse("https://stdgems.org/bundled_gems.json").read
|
35
35
|
bundled_gems = JSON.parse(res)["gems"].map{_1["gem"]}
|
36
|
-
system "gem uninstall
|
36
|
+
system "gem uninstall #{bundled_gems.join(" ")} --force", exception: true
|
37
37
|
'
|
38
38
|
- name: bundle install
|
39
39
|
run: |
|
data/CHANGELOG.md
CHANGED
@@ -1,31 +1,5 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## 3.9.4 (2025-05-15)
|
4
|
-
|
5
|
-
### Miscellaneous
|
6
|
-
|
7
|
-
* Backport test/CI fixes to 3.9 ([#2487](https://github.com/ruby/rbs/pull/2487))
|
8
|
-
* Use erb instead of set for load path testing ([#2468](https://github.com/ruby/rbs/pull/2468))
|
9
|
-
|
10
|
-
## 3.9.3 (2025-05-09)
|
11
|
-
|
12
|
-
### Miscellaneous
|
13
|
-
|
14
|
-
* Use erb instead of set for load path testing ([#2468](https://github.com/ruby/rbs/pull/2468))
|
15
|
-
|
16
|
-
## 3.9.2 (2025-03-31)
|
17
|
-
|
18
|
-
### Library changes
|
19
|
-
|
20
|
-
* Change `{}` to `{ 0 }` ([#2354](https://github.com/ruby/rbs/pull/2354))
|
21
|
-
|
22
|
-
## 3.9.1 (2025-03-24)
|
23
|
-
|
24
|
-
### Miscellaneous
|
25
|
-
|
26
|
-
* `did_you_mean` is a default gem ([#2348](https://github.com/ruby/rbs/pull/2348))
|
27
|
-
* Skip loading ruby_memcheck ([#2347](https://github.com/ruby/rbs/pull/2347))
|
28
|
-
|
29
3
|
## 3.9.0 (2025-03-18)
|
30
4
|
|
31
5
|
### Miscellaneous
|
data/Rakefile
CHANGED
@@ -36,12 +36,12 @@ end
|
|
36
36
|
multitask :default => [:test, :stdlib_test, :typecheck_test, :rubocop, :validate, :test_doc]
|
37
37
|
|
38
38
|
task :lexer do
|
39
|
-
sh "re2c -W --no-generation-date -o
|
39
|
+
sh "re2c -W --no-generation-date -o src/lexer.c src/lexer.re"
|
40
40
|
end
|
41
41
|
|
42
42
|
task :confirm_lexer => :lexer do
|
43
43
|
puts "Testing if lexer.c is updated with respect to lexer.re"
|
44
|
-
sh "git diff --exit-code
|
44
|
+
sh "git diff --exit-code src/lexer.c"
|
45
45
|
end
|
46
46
|
|
47
47
|
task :confirm_templates => :templates do
|
@@ -70,17 +70,19 @@ task :confirm_annotation do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
task :templates do
|
73
|
-
sh "#{ruby} templates/template.rb
|
74
|
-
sh "#{ruby} templates/template.rb
|
75
|
-
|
76
|
-
sh "#{ruby} templates/template.rb
|
73
|
+
sh "#{ruby} templates/template.rb ext/rbs_extension/ast_translation.h"
|
74
|
+
sh "#{ruby} templates/template.rb ext/rbs_extension/ast_translation.c"
|
75
|
+
|
76
|
+
sh "#{ruby} templates/template.rb ext/rbs_extension/class_constants.h"
|
77
|
+
sh "#{ruby} templates/template.rb ext/rbs_extension/class_constants.c"
|
78
|
+
|
79
|
+
sh "#{ruby} templates/template.rb include/rbs/ast.h"
|
80
|
+
sh "#{ruby} templates/template.rb src/ast.c"
|
77
81
|
end
|
78
82
|
|
79
|
-
task :compile => "ext/rbs_extension/
|
80
|
-
task :compile => "
|
81
|
-
task :compile => "
|
82
|
-
task :compile => "src/constants.c"
|
83
|
-
task :compile => "src/ruby_objs.c"
|
83
|
+
task :compile => "ext/rbs_extension/class_constants.h"
|
84
|
+
task :compile => "ext/rbs_extension/class_constants.c"
|
85
|
+
task :compile => "src/lexer.c"
|
84
86
|
|
85
87
|
task :test_doc do
|
86
88
|
files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
@@ -141,16 +143,21 @@ task :stdlib_test => :compile do
|
|
141
143
|
end
|
142
144
|
|
143
145
|
task :typecheck_test => :compile do
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
146
|
+
puts
|
147
|
+
puts
|
148
|
+
puts "⛔️⛔️⛔️⛔️⛔️⛔️ Skipping type check test because RBS is incompatible with Steep (#{__FILE__}:#{__LINE__})"
|
149
|
+
puts
|
150
|
+
puts
|
151
|
+
# FileList["test/typecheck/*"].each do |test|
|
152
|
+
# Dir.chdir(test) do
|
153
|
+
# expectations = File.join(test, "steep_expectations.yml")
|
154
|
+
# if File.exist?(expectations)
|
155
|
+
# sh "steep check --with_expectations"
|
156
|
+
# else
|
157
|
+
# sh "steep check"
|
158
|
+
# end
|
159
|
+
# end
|
160
|
+
# end
|
154
161
|
end
|
155
162
|
|
156
163
|
task :raap => :compile do
|
data/Steepfile
CHANGED
@@ -9,6 +9,7 @@ target :lib do
|
|
9
9
|
)
|
10
10
|
|
11
11
|
library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'prettyprint', 'yaml', "psych", "securerandom"
|
12
|
+
library "prism"
|
12
13
|
signature "stdlib/strscan/0/"
|
13
14
|
signature "stdlib/optparse/0/"
|
14
15
|
signature "stdlib/rdoc/0/"
|