rbs 3.9.2 → 4.0.0.dev.2
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 +29 -1
- data/.github/workflows/windows.yml +1 -1
- data/CHANGELOG.md +0 -13
- data/Rakefile +36 -21
- data/Steepfile +1 -0
- data/config.yml +232 -62
- data/ext/rbs_extension/ast_translation.c +1151 -0
- data/ext/rbs_extension/ast_translation.h +34 -0
- data/{src/constants.c → ext/rbs_extension/class_constants.c} +15 -1
- data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +14 -1
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +7 -1
- data/ext/rbs_extension/{location.c → legacy_location.c} +25 -34
- data/ext/rbs_extension/legacy_location.h +45 -0
- data/ext/rbs_extension/main.c +402 -8
- data/ext/rbs_extension/rbs_extension.h +6 -21
- data/ext/rbs_extension/rbs_string_bridging.c +9 -0
- data/ext/rbs_extension/rbs_string_bridging.h +24 -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 +71 -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: 0f04dce135a1eb82da13c36f9a8ac01710c75cc2d2943643508b94187f281529
|
4
|
+
data.tar.gz: e4ddb5b4dd310100eb75e07b0a88a1cd92a2787f262db440b33834fbdd595b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55dc93bbac5c8472d7241e999bfa879ee6fe2c4e8e518eebae130596fc650a9e512a6140fc52d62be3b11751a3fb6414c7cdd8aeed85423e65077862223435f9
|
7
|
+
data.tar.gz: c160219cfb46afc018c8f5a1e21d10d21ba517f5f13b74d3871add96713fefe3597865d0907fc59f229098f7e13d3de729026136ee1eb15e0055ce90abfc8b9c
|
data/.github/workflows/ruby.yml
CHANGED
@@ -83,7 +83,7 @@ jobs:
|
|
83
83
|
valgrind:
|
84
84
|
runs-on: ubuntu-latest
|
85
85
|
steps:
|
86
|
-
- uses: actions/checkout@
|
86
|
+
- uses: actions/checkout@v4
|
87
87
|
- uses: ruby/setup-ruby@v1
|
88
88
|
with:
|
89
89
|
ruby-version: "3.4"
|
@@ -106,3 +106,31 @@ jobs:
|
|
106
106
|
- run: bundle exec rake test:valgrind
|
107
107
|
env:
|
108
108
|
RUBY_FREE_AT_EXIT: 1
|
109
|
+
C99_compile:
|
110
|
+
runs-on: macos-latest
|
111
|
+
strategy:
|
112
|
+
fail-fast: false
|
113
|
+
matrix:
|
114
|
+
ruby: ['3.4', head]
|
115
|
+
steps:
|
116
|
+
- uses: actions/checkout@v4
|
117
|
+
- name: Install dependencies
|
118
|
+
run: |
|
119
|
+
brew install ruby-build
|
120
|
+
- uses: ruby/setup-ruby@v1
|
121
|
+
with:
|
122
|
+
ruby-version: ${{ matrix.ruby }}
|
123
|
+
bundler: none
|
124
|
+
- name: Set working directory as safe
|
125
|
+
run: git config --global --add safe.directory $(pwd)
|
126
|
+
- name: Update rubygems & bundler
|
127
|
+
run: |
|
128
|
+
ruby -v
|
129
|
+
gem update --system
|
130
|
+
- name: clang version
|
131
|
+
run: clang --version
|
132
|
+
- name: bin/setup
|
133
|
+
run: |
|
134
|
+
bin/setup
|
135
|
+
- run: bundle exec rake clean compile_c99
|
136
|
+
|
@@ -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,18 +1,5 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## 3.9.2 (2025-03-31)
|
4
|
-
|
5
|
-
### Library changes
|
6
|
-
|
7
|
-
* Change `{}` to `{ 0 }` ([#2354](https://github.com/ruby/rbs/pull/2354))
|
8
|
-
|
9
|
-
## 3.9.1 (2025-03-24)
|
10
|
-
|
11
|
-
### Miscellaneous
|
12
|
-
|
13
|
-
* `did_you_mean` is a default gem ([#2348](https://github.com/ruby/rbs/pull/2348))
|
14
|
-
* Skip loading ruby_memcheck ([#2347](https://github.com/ruby/rbs/pull/2347))
|
15
|
-
|
16
3
|
## 3.9.0 (2025-03-18)
|
17
4
|
|
18
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
|
@@ -430,3 +437,11 @@ task :changelog do
|
|
430
437
|
puts " (🤑 There is no *unreleased* pull request associated to the milestone.)"
|
431
438
|
end
|
432
439
|
end
|
440
|
+
|
441
|
+
desc "Compile extension without C23 extensions"
|
442
|
+
task :compile_c99 do
|
443
|
+
ENV["TEST_NO_C23"] = "true"
|
444
|
+
Rake::Task[:"compile"].invoke
|
445
|
+
ensure
|
446
|
+
ENV.delete("TEST_NO_C23")
|
447
|
+
end
|
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/"
|