From 9bab22589c6fed6a595c72e52981cca5ead072f3 Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 7 Jun 2024 16:19:02 +0900 Subject: [PATCH 1/3] Fix an indentation in sig/lrama/options.rbs --- sig/lrama/options.rbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sig/lrama/options.rbs b/sig/lrama/options.rbs index 2b25485f..a186075a 100644 --- a/sig/lrama/options.rbs +++ b/sig/lrama/options.rbs @@ -1,5 +1,5 @@ module Lrama - class Options + class Options attr_accessor skeleton: String attr_accessor header: bool attr_accessor header_file: String? @@ -13,5 +13,5 @@ module Lrama attr_accessor debug: bool def initialize: () -> void - end + end end From e9df5fc46c457467877627548389c8983408b41b Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 7 Jun 2024 16:19:40 +0900 Subject: [PATCH 2/3] Fix rbs validate warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ❯ bundle exec rbs -I sig validate W, [2024-06-07T16:09:23.137310 #4825] WARN -- rbs: sig/lrama/grammar.rbs:74:19...74:37: `void` type is only allowed in return type or generics parameter (RBS::WillSyntaxError) def validate!: () -> (void | bot) ^^^^^^^^^^^^^^^^^^ ``` --- sig/lrama/grammar.rbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sig/lrama/grammar.rbs b/sig/lrama/grammar.rbs index 9763bd1e..74a05d68 100644 --- a/sig/lrama/grammar.rbs +++ b/sig/lrama/grammar.rbs @@ -71,7 +71,7 @@ module Lrama def epilogue_first_lineno=: (Integer epilogue_first_lineno) -> Integer def epilogue=: (String epilogue) -> String def prepare: () -> void - def validate!: () -> (void | bot) + def validate!: () -> void def find_rules_by_symbol!: (Grammar::Symbol sym) -> Array[Rule] def find_rules_by_symbol: (Grammar::Symbol sym) -> Array[Rule]? From 0f2d99a9f63f839d02713462c3d0eeb1d984e19a Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 7 Jun 2024 16:22:40 +0900 Subject: [PATCH 3/3] Use void instead of bot? The bot is used for methods that either always throw an exception or enter an infinite loop and never terminate. Therefore, I believe void is correct here. --- sig/lrama/grammar.rbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sig/lrama/grammar.rbs b/sig/lrama/grammar.rbs index 74a05d68..072e2e51 100644 --- a/sig/lrama/grammar.rbs +++ b/sig/lrama/grammar.rbs @@ -88,6 +88,6 @@ module Lrama def fill_default_precedence: () -> void def fill_symbols: () -> Array[Grammar::Symbol] def fill_sym_to_rules: () -> Array[Rule] - def validate_rule_lhs_is_nterm!: () -> bot? + def validate_rule_lhs_is_nterm!: () -> void end end