From dce587d4af93b9fc4bcd6345e5db9bb7b7e4ff1c Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 9 Dec 2024 16:30:02 +0900 Subject: [PATCH 1/7] Update rbs and steep gem versions to 3.7.0 and 1.9.1 respectively --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 58c28f79..870fde0e 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,6 @@ gem "memory_profiler" # Recent steep requires Ruby >= 3.0.0. # Then skip install on some CI jobs. if !ENV['GITHUB_ACTION'] || ENV['INSTALL_STEEP'] == 'true' - gem "rbs", "3.6.0", require: false - gem "steep", "1.8.0", require: false + gem "rbs", "3.7.0", require: false + gem "steep", "1.9.1", require: false end From 1776e4b1047c37ce1e1def6097edf04738567116 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 9 Dec 2024 16:30:23 +0900 Subject: [PATCH 2/7] bundle exec rbs collection update --- rbs_collection.lock.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rbs_collection.lock.yaml b/rbs_collection.lock.yaml index b53cb101..2e642e97 100644 --- a/rbs_collection.lock.yaml +++ b/rbs_collection.lock.yaml @@ -1,6 +1,14 @@ --- path: ".gem_rbs_collection" gems: +- name: diff-lcs + version: '1.5' + source: + type: git + name: ruby/gem_rbs_collection + revision: f2fa96be08e0f7fe5237a45d2b69d9d7a5d0b416 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: erb version: '0' source: @@ -18,7 +26,7 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 4b0d2f72e63b6c3e92dc54e19ce23dd24524f9a7 + revision: f2fa96be08e0f7fe5237a45d2b69d9d7a5d0b416 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems - name: stackprof @@ -26,7 +34,7 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 4b0d2f72e63b6c3e92dc54e19ce23dd24524f9a7 + revision: f2fa96be08e0f7fe5237a45d2b69d9d7a5d0b416 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems - name: strscan From 134c9905e2035e0aa3e0c165f661da8f698a92c2 Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 15 Dec 2024 10:31:30 +0900 Subject: [PATCH 3/7] Fix a warning for Ruby::UnannotatedEmptyCollection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lib/lrama/grammar/parameterizing_rule/rhs.rb:19:23: [warning] Empty hash doesn't have type annotation │ Diagnostic ID: Ruby::UnannotatedEmptyCollection │ └ var_to_arg = {} ~~ ``` --- lib/lrama/grammar/parameterizing_rule/rhs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lrama/grammar/parameterizing_rule/rhs.rb b/lib/lrama/grammar/parameterizing_rule/rhs.rb index d574841d..f60781c0 100644 --- a/lib/lrama/grammar/parameterizing_rule/rhs.rb +++ b/lib/lrama/grammar/parameterizing_rule/rhs.rb @@ -16,7 +16,7 @@ def resolve_user_code(bindings) return unless user_code resolved = Lexer::Token::UserCode.new(s_value: user_code.s_value, location: user_code.location) - var_to_arg = {} + var_to_arg = {} #: Hash[String, String] symbols.each do |sym| resolved_sym = bindings.resolve_symbol(sym) if resolved_sym != sym From ddf674d5a100520e8f796d09c18a7b83fabf7368 Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 15 Dec 2024 10:31:57 +0900 Subject: [PATCH 4/7] Fix a warning for Ruby::UnannotatedEmptyCollection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lib/lrama/bitmap.rb:16:10: [warning] Empty array doesn't have type annotation │ Diagnostic ID: Ruby::UnannotatedEmptyCollection │ └ a = [] ~~ ``` --- lib/lrama/bitmap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lrama/bitmap.rb b/lib/lrama/bitmap.rb index 23cbd30d..b2de0248 100644 --- a/lib/lrama/bitmap.rb +++ b/lib/lrama/bitmap.rb @@ -13,7 +13,7 @@ def self.from_array(ary) end def self.to_array(int) - a = [] + a = [] #: Array[Integer] i = 0 while int > 0 do From 5227189f0272362896aac8060a6d9a62370449bb Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 15 Dec 2024 10:32:25 +0900 Subject: [PATCH 5/7] Fix a warning for Ruby::UnannotatedEmptyCollection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lib/lrama/grammar/rule_builder.rb:70:28: [warning] Empty array doesn't have type annotation │ Diagnostic ID: Ruby::UnannotatedEmptyCollection │ └ resolved_builders = [] ~~ ``` --- lib/lrama/grammar/rule_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lrama/grammar/rule_builder.rb b/lib/lrama/grammar/rule_builder.rb index f6df22b6..06097eb7 100644 --- a/lib/lrama/grammar/rule_builder.rb +++ b/lib/lrama/grammar/rule_builder.rb @@ -67,7 +67,7 @@ def has_inline_rules? end def resolve_inline_rules - resolved_builders = [] + resolved_builders = [] #: Array[RuleBuilder] rhs.each_with_index do |token, i| if (inline_rule = @parameterizing_rule_resolver.find_inline(token)) inline_rule.rhs_list.each do |inline_rhs| From fb3ecbbaf890094c34b90db41d6a3078ea9ba172 Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 15 Dec 2024 10:32:46 +0900 Subject: [PATCH 6/7] Fix a warning for Ruby::UnannotatedEmptyCollection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lib/lrama/lexer/token/user_code.rb:19:23: [warning] Empty array doesn't have type annotation │ Diagnostic ID: Ruby::UnannotatedEmptyCollection │ └ references = [] ~~ ``` --- lib/lrama/lexer/token/user_code.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lrama/lexer/token/user_code.rb b/lib/lrama/lexer/token/user_code.rb index 97122086..c606200d 100644 --- a/lib/lrama/lexer/token/user_code.rb +++ b/lib/lrama/lexer/token/user_code.rb @@ -16,7 +16,7 @@ def references def _references scanner = StringScanner.new(s_value) - references = [] + references = [] #: Array[Grammar::Reference] until scanner.eos? do case From a48c27d6339ef13fa010f0f721e47ca60bd10e9f Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 15 Dec 2024 10:33:06 +0900 Subject: [PATCH 7/7] Fix a warning for Ruby::UnannotatedEmptyCollection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lib/lrama/grammar.rb:385:15: [warning] Empty array doesn't have type annotation │ Diagnostic ID: Ruby::UnannotatedEmptyCollection │ └ errors = [] ~~ ``` --- lib/lrama/grammar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lrama/grammar.rb b/lib/lrama/grammar.rb index 3724f828..ee57b3c5 100644 --- a/lib/lrama/grammar.rb +++ b/lib/lrama/grammar.rb @@ -382,7 +382,7 @@ def fill_sym_to_rules end def validate_rule_lhs_is_nterm! - errors = [] + errors = [] #: Array[String] rules.each do |rule| next if rule.lhs.nterm?