Skip to content

Commit

Permalink
Merge pull request #279 from ydah/rbs-fix
Browse files Browse the repository at this point in the history
Organize rbs in grammar and lexer/token
  • Loading branch information
yui-knk authored Dec 2, 2023
2 parents 77439d9 + f7724c5 commit e044a24
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions sig/lrama/grammar/parameterizing_rules/builder.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ module Lrama
@token: Lexer::Token::Parameterizing
@key: Symbol
@rule_counter: Counter
@lhs: Lexer::Token
@lhs_tag: untyped
@user_code: Lexer::Token::UserCode?
@precedence_sym: Lexer::Token?
@line: Integer?
@builder: Grammar::ParameterizingRules::Builder::Base

def initialize: (Lexer::Token token, Counter rule_counter, untyped lhs_tag, Lexer::Token::UserCode? user_code, Lexer::Token? precedence_sym, Integer? line) -> void
def build: () -> Array[Rule]
def build_token: () -> Lrama::Lexer::Token
def build_token: () -> Lexer::Token
def create_builder: () -> void
def validate_key!: () -> void
end
Expand Down
4 changes: 3 additions & 1 deletion sig/lrama/grammar/parameterizing_rules/builder/base.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ module Lrama
class ParameterizingRules
class Builder
class Base
attr_reader build_token: Lexer::Token::Ident

def initialize: (Lexer::Token::Parameterizing token, Counter rule_counter, untyped lhs_tag, Lexer::Token::UserCode? user_code, Lexer::Token? precedence_sym, Integer? line) -> void
def build: () -> Array[Rule]

@args: Array[Lexer::Token]
@token: Lexer::Token::Parameterizing
@key: Symbol
@rule_counter: Counter
@lhs: Lexer::Token
@lhs_tag: untyped
@user_code: Lexer::Token::UserCode?
@precedence_sym: Lexer::Token?
@line: Integer?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Lrama
class ParameterizingRules
class Builder
class SeparatedList < Base
@separator: Lexer::Token

def initialize: (Lexer::Token token, Counter rule_counter, untyped lhs_tag, Lexer::Token::UserCode? user_code, Lexer::Token? precedence_sym, Integer? line) -> void
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Lrama
class ParameterizingRules
class Builder
class SeparatedNonemptyList < Base
@separator: Lexer::Token

def initialize: (Lexer::Token token, Counter rule_counter, untyped lhs_tag, Lexer::Token::UserCode? user_code, Lexer::Token? precedence_sym, Integer? line) -> void
end
end
Expand Down
4 changes: 2 additions & 2 deletions sig/lrama/lexer/token/parameterizing.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module Lrama
class Lexer
class Token
class Parameterizing < Token
attr_accessor args: Array[Lrama::Lexer::Token]
attr_accessor args: Array[Lexer::Token]

def initialize: (s_value: String, ?alias_name: String, ?location: Location, ?args: Array[Lrama::Lexer::Token]) -> void
def initialize: (s_value: String, ?alias_name: String, ?location: Location, ?args: Array[Lexer::Token]) -> void

def option?: () -> bool
def nonempty_list?: () -> bool
Expand Down

0 comments on commit e044a24

Please sign in to comment.