Skip to content

Commit

Permalink
Add types for initialize method
Browse files Browse the repository at this point in the history
  • Loading branch information
Little-Rubyist committed Jul 16, 2024
1 parent 7a6eed3 commit 2f45b40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions sig/lrama/state/reduce_reduce_conflict.rbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module Lrama
class State
class ReduceReduceConflict
attr_accessor symbols: Array[Grammar::Symbol?]
attr_accessor reduce1: State::Reduce
attr_accessor reduce2: State::Reduce
attr_accessor symbols: Array[Grammar::Symbol?]
attr_accessor reduce1: State::Reduce
attr_accessor reduce2: State::Reduce

def initialize: (?symbols: Array[Grammar::Symbol?], ?reduce1: State::Reduce, ?reduce2: State::Reduce) -> void

def type: () -> :reduce_reduce
end
Expand Down
2 changes: 2 additions & 0 deletions sig/lrama/state/resolved_conflict.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module Lrama
attr_accessor which: (:reduce | :shift)
attr_accessor same_prec: bool

def initialize: (?symbol: Grammar::Symbol, ?reduce: State::Reduce, ?which: (:reduce | :shift), ?same_prec: bool) -> void

def report_message: () -> (::String | bot)
end
end
Expand Down
8 changes: 5 additions & 3 deletions sig/lrama/state/shift_reduce_conflict.rbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module Lrama
class State
class ShiftReduceConflict
attr_accessor symbols: Array[Grammar::Symbol]
attr_accessor shift: State::Shift
attr_accessor reduce: State::Reduce
attr_accessor symbols: Array[Grammar::Symbol]
attr_accessor shift: State::Shift
attr_accessor reduce: State::Reduce

def initialize: (?symbols: Array[Grammar::Symbol], ?shift: State::Shift, ?reduce: State::Reduce) -> void

def type: () -> :shift_reduce
end
Expand Down

0 comments on commit 2f45b40

Please sign in to comment.