diff --git a/lib/propane/lexer.rb b/lib/propane/lexer.rb index 257ebae..cd6d6cf 100644 --- a/lib/propane/lexer.rb +++ b/lib/propane/lexer.rb @@ -24,14 +24,8 @@ class Propane } states = mode_info[:dfa].enumerate states.each do |state, id| - token = - if state.accepts && state.accepts.token - state.accepts.token.id - end - code_id = - if state.accepts && state.accepts.code_id - state.accepts.code_id - end + token = state.accepts && state.accepts.token && state.accepts.token.id + code_id = state.accepts && state.accepts.code_id && state.accepts.code_id state_table << { transition_table_index: transition_table.size, n_transitions: state.transitions.size, diff --git a/lib/propane/rule_set.rb b/lib/propane/rule_set.rb index 68e1705..3832a81 100644 --- a/lib/propane/rule_set.rb +++ b/lib/propane/rule_set.rb @@ -4,7 +4,7 @@ class Propane # @return [Integer] # ID of the RuleSet. - attr_accessor :id + attr_reader :id # @return [String] # Name of the RuleSet.