rbs 1.7.0.beta.2 → 1.7.0
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 +20 -1
- data/.gitignore +9 -2
- data/CHANGELOG.md +36 -9
- data/Rakefile +15 -0
- data/Steepfile +0 -1
- data/core/binding.rbs +2 -0
- data/core/complex.rbs +0 -2
- data/core/env.rbs +881 -0
- data/core/false_class.rbs +2 -0
- data/core/float.rbs +0 -2
- data/core/integer.rbs +0 -2
- data/core/nil_class.rbs +2 -0
- data/core/numeric.rbs +7 -0
- data/core/object.rbs +1 -1
- data/core/proc.rbs +2 -0
- data/core/rational.rbs +0 -2
- data/core/symbol.rbs +2 -0
- data/core/true_class.rbs +2 -0
- data/core/unbound_method.rbs +13 -0
- data/docs/rbs_by_example.md +2 -2
- data/docs/syntax.md +2 -3
- data/ext/rbs_extension/constants.c +0 -1
- data/ext/rbs_extension/lexer.c +2526 -1063
- data/ext/rbs_extension/lexer.h +33 -17
- data/ext/rbs_extension/lexer.re +140 -0
- data/ext/rbs_extension/lexstate.c +139 -0
- data/ext/rbs_extension/parser.c +2 -32
- data/ext/rbs_extension/parser.h +0 -5
- data/ext/rbs_extension/parserstate.c +0 -1
- data/ext/rbs_extension/rbs_extension.h +1 -1
- data/ext/rbs_extension/ruby_objs.c +84 -148
- data/ext/rbs_extension/ruby_objs.h +0 -2
- data/lib/rbs/collection/installer.rb +1 -0
- data/lib/rbs/collection/sources/git.rb +6 -1
- data/lib/rbs/errors.rb +6 -0
- data/lib/rbs/parser_aux.rb +37 -5
- data/lib/rbs/parser_compat/lexer_error.rb +4 -0
- data/lib/rbs/parser_compat/located_value.rb +5 -0
- data/lib/rbs/parser_compat/semantics_error.rb +4 -0
- data/lib/rbs/parser_compat/syntax_error.rb +4 -0
- data/lib/rbs/prototype/helpers.rb +113 -0
- data/lib/rbs/prototype/rb.rb +2 -105
- data/lib/rbs/prototype/runtime.rb +16 -0
- data/lib/rbs/test/setup.rb +1 -0
- data/lib/rbs/types.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +12 -0
- data/sig/parser.rbs +2 -0
- data/sig/rbs.rbs +4 -0
- data/stdlib/bigdecimal/0/big_decimal.rbs +44 -0
- data/stdlib/csv/0/csv.rbs +49 -3
- data/stdlib/io-console/0/io-console.rbs +137 -0
- data/stdlib/net-http/0/net-http.rbs +2 -1
- data/stdlib/tempfile/0/tempfile.rbs +4 -6
- metadata +13 -5
- data/lib/rbs/parser.y +0 -1805
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e6fc59a79d872f87e6e58e32c2c92d70ec59c0fad26d5a094a7a21d4b108e6c
|
4
|
+
data.tar.gz: 950a60b79c02ebdd4d6dd39ff2fc0c7fef9a69843111bc7ed6640c732afd0d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59a9dbf9bbd5c85e3462fb5d0e1edf9a879b87db78cf409a5af921a40ce375f72a7475fe0c7eda0350ed604e876197262e0195a4812177410ff1b31edf41252
|
7
|
+
data.tar.gz: b739f7415fefb9ed0cb5db63de98ab648dcd320ac98abd9211bb85448f3fbb14855fcb61715a6c6f4cf520308b2fa0a73c93217bd4e0dd8818d759446e3a6264
|
data/.github/workflows/ruby.yml
CHANGED
@@ -15,10 +15,18 @@ jobs:
|
|
15
15
|
- master-nightly-focal
|
16
16
|
- 3.0-focal
|
17
17
|
- 2.7-bionic
|
18
|
+
- 2.6-bionic
|
18
19
|
job:
|
19
20
|
- test
|
20
21
|
- stdlib_test
|
21
22
|
- rubocop validate test_doc build test_generate_stdlib
|
23
|
+
- lexer confirm_lexer
|
24
|
+
- lexer compile
|
25
|
+
exclude:
|
26
|
+
- container_tag: master-nightly-focal
|
27
|
+
job: confirm_lexer
|
28
|
+
- container_tag: 2.6-bionic
|
29
|
+
job: stdlib_test
|
22
30
|
container:
|
23
31
|
image: rubylang/ruby:${{ matrix.container_tag }}
|
24
32
|
steps:
|
@@ -26,7 +34,18 @@ jobs:
|
|
26
34
|
- name: Install dependencies
|
27
35
|
run: |
|
28
36
|
apt-get update
|
29
|
-
apt-get install -y libdb-dev
|
37
|
+
apt-get install -y libdb-dev curl autoconf automake m4 libtool
|
38
|
+
- name: Install Re2c
|
39
|
+
if: contains(matrix.job, 'lexer')
|
40
|
+
run: |
|
41
|
+
cd /tmp
|
42
|
+
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/2.2.tar.gz > re2c-2.2.tar.gz
|
43
|
+
tar xf re2c-2.2.tar.gz
|
44
|
+
cd re2c-2.2
|
45
|
+
autoreconf -i -W all
|
46
|
+
./configure
|
47
|
+
make
|
48
|
+
make install
|
30
49
|
- name: Update rubygems & bundler
|
31
50
|
run: |
|
32
51
|
ruby -v
|
data/.gitignore
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
/.bundle/
|
2
|
+
/vendor/bundle/
|
2
3
|
/steep/.bundle/
|
4
|
+
/steep/vendor/bundle/
|
3
5
|
/.yardoc
|
4
6
|
/_yardoc/
|
5
7
|
/coverage/
|
6
8
|
/pkg/
|
7
9
|
/spec/reports/
|
8
10
|
/tmp/
|
9
|
-
|
10
|
-
|
11
|
+
**/.ruby-version
|
12
|
+
**/.rvmrc
|
13
|
+
**/.rbfu-version
|
14
|
+
**/.rbenv-version
|
15
|
+
**/.versions.conf
|
11
16
|
/vendor/sigs
|
12
17
|
/Gemfile.lock
|
13
18
|
|
14
19
|
lib/**/*.bundle
|
20
|
+
lib/**/*.so
|
21
|
+
lib/**/*.dll
|
data/CHANGELOG.md
CHANGED
@@ -2,20 +2,47 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
-
## 1.7.0 (
|
5
|
+
## 1.7.0 (2021-11-11)
|
6
6
|
|
7
|
-
|
7
|
+
This version replaces `RBS::Parser` implementation from pure Ruby code based on [Racc](https://github.com/ruby/racc) to C extension.
|
8
|
+
It improves the RBS file parsing performance up to 5 times faster. :rocket:
|
8
9
|
|
9
|
-
*
|
10
|
+
* There are some incompatibilties to drop obsolete syntax rules: `super` keyword and `any` type are no longer supported.
|
11
|
+
* [re2c](https://github.com/skvadrik/re2c) is used to generate lexical generator.
|
12
|
+
|
13
|
+
When you want to change the parser/lexer, change the files under `ext/rbs_extension` directory and run `rake compile` to compile the extension.
|
14
|
+
|
15
|
+
### Signature updates
|
16
|
+
|
17
|
+
* io/console ([\#783](https://github.com/ruby/rbs/pull/783))
|
18
|
+
* `ENV` -- Note that it introduces a dummy `::ENVClass` class, which is not defined in Ruby. ([\#812](https://github.com/ruby/rbs/pull/812))
|
19
|
+
* `Net::HTTPRequest` ([\#784](https://github.com/ruby/rbs/pull/784))
|
20
|
+
* `#clone` ([#811](https://github.com/ruby/rbs/pull/811), [\#813](https://github.com/ruby/rbs/pull/813))
|
21
|
+
* `Kernel#BigDecimal` ([\#817](https://github.com/ruby/rbs/pull/817))
|
22
|
+
* `Tempfile.new`, `Tempfile.create` ([\#792](https://github.com/ruby/rbs/pull/792), [\#791](https://github.com/ruby/rbs/pull/791))
|
23
|
+
|
24
|
+
### Library changes
|
25
|
+
|
26
|
+
* Replace `RBS::Parser` ([#788](https://github.com/ruby/rbs/pull/788), [#789](https://github.com/ruby/rbs/pull/789))
|
27
|
+
* Fix unexpected `CollectionNotAvailable` without `gems` from git source ([\#795](https://github.com/ruby/rbs/pull/795))
|
28
|
+
* Print deprecation warning ([\#801](https://github.com/ruby/rbs/pull/801))
|
29
|
+
* Make `Parser::KEYWORDS` a hash ([\#804](https://github.com/ruby/rbs/pull/804))
|
30
|
+
* Use _partial clone_ for `rbs collection` installer ([#805](https://github.com/ruby/rbs/pull/805))
|
31
|
+
* Respect logger level for test/setup logger ([\#819](https://github.com/ruby/rbs/pull/819), [\#822](https://github.com/ruby/rbs/pull/822))
|
32
|
+
|
33
|
+
## Miscellaneous
|
34
|
+
|
35
|
+
* Avoid a mixture of `Array#filter` and `Array#select` ([\#820](https://github.com/ruby/rbs/pull/820))
|
36
|
+
* Remove leftover documentation about `super` ([\#807](https://github.com/ruby/rbs/pull/807))
|
10
37
|
|
11
38
|
## 1.6.2 (2021-09-09)
|
12
39
|
|
13
|
-
|
40
|
+
### Signature updates
|
14
41
|
|
15
42
|
* `Enumerator::Lazy#force` ([\#782](https://github.com/ruby/rbs/pull/782))
|
16
43
|
* `IO.readlines` ([\#780](https://github.com/ruby/rbs/pull/780))
|
17
44
|
|
18
|
-
|
45
|
+
### Miscellaneous
|
19
46
|
|
20
47
|
* Set `$XDG_CACHE_HOME` during test ([\#781](https://github.com/ruby/rbs/pull/781))
|
21
48
|
|
@@ -23,7 +50,7 @@
|
|
23
50
|
|
24
51
|
This is a minor release including test fixes.
|
25
52
|
|
26
|
-
|
53
|
+
### Miscellaneous
|
27
54
|
|
28
55
|
* Fix stdlib test for `Resolv::Hosts` by removing `/etc/hosts` dependency ([\#779](https://github.com/ruby/rbs/pull/779))
|
29
56
|
* Fix bundler related test for test-bundled-gems ([\#778](https://github.com/ruby/rbs/pull/778))
|
@@ -35,18 +62,18 @@ The command helps you manage RBS files from gem_rbs_collection or other reposito
|
|
35
62
|
|
36
63
|
This feature is a preview, and any feedback is welcome!
|
37
64
|
|
38
|
-
|
65
|
+
### Signature updates
|
39
66
|
|
40
67
|
* objspace ([\#763](https://github.com/ruby/rbs/pull/763), [\#776](https://github.com/ruby/rbs/pull/776))
|
41
68
|
* tempfile ([\#767](https://github.com/ruby/rbs/pull/767), [\#775](https://github.com/ruby/rbs/pull/775))
|
42
69
|
* `IO#set_encoding_by_bom` ([\#106](https://github.com/ruby/rbs/pull/106))
|
43
70
|
* `OpenSSL::PKey::EC#dh_compute_key` ([\#775](https://github.com/ruby/rbs/pull/775))
|
44
71
|
|
45
|
-
|
72
|
+
### Library changes
|
46
73
|
|
47
74
|
* Add `rbs collection` ([\#589](https://github.com/ruby/rbs/pull/589), [\#772](https://github.com/ruby/rbs/pull/772), [\#773](https://github.com/ruby/rbs/pull/773))
|
48
75
|
|
49
|
-
|
76
|
+
### Miscellaneous
|
50
77
|
|
51
78
|
* Let `bin/annotate-with-rdoc` process nested constants/classes ([\#766](https://github.com/ruby/rbs/pull/766), [\#768](https://github.com/ruby/rbs/pull/768))
|
52
79
|
* Stop printing version mismatch message in CI ([\#777](https://github.com/ruby/rbs/pull/777))
|
data/Rakefile
CHANGED
@@ -21,6 +21,21 @@ end
|
|
21
21
|
|
22
22
|
multitask :default => [:test, :stdlib_test, :rubocop, :validate, :test_doc]
|
23
23
|
|
24
|
+
task :lexer do
|
25
|
+
sh "re2c -W --no-generation-date -o ext/rbs_extension/lexer.c ext/rbs_extension/lexer.re"
|
26
|
+
end
|
27
|
+
|
28
|
+
task :confirm_lexer => :lexer do
|
29
|
+
puts "Testing if lexer.c is updated with respect to lexer.re"
|
30
|
+
sh "git diff --exit-code ext/rbs_extension/lexer.c"
|
31
|
+
end
|
32
|
+
|
33
|
+
rule ".c" => ".re" do |t|
|
34
|
+
puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake lexer` ⚠️⚠️⚠️"
|
35
|
+
end
|
36
|
+
|
37
|
+
task :compile => "ext/rbs_extension/lexer.c"
|
38
|
+
|
24
39
|
task :test_doc do
|
25
40
|
files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
26
41
|
`git ls-files -z`.split("\x0").select do |file| Pathname(file).extname == ".md" end
|
data/Steepfile
CHANGED
data/core/binding.rbs
CHANGED