Make RuleSet#id read-only

This commit is contained in:
Josh Holtrop 2023-07-08 11:17:11 -04:00
parent 6daca1e73f
commit 0a7938038b
2 changed files with 3 additions and 9 deletions

View File

@ -24,14 +24,8 @@ class Propane
} }
states = mode_info[:dfa].enumerate states = mode_info[:dfa].enumerate
states.each do |state, id| states.each do |state, id|
token = token = state.accepts && state.accepts.token && state.accepts.token.id
if state.accepts && state.accepts.token code_id = state.accepts && state.accepts.code_id && state.accepts.code_id
state.accepts.token.id
end
code_id =
if state.accepts && state.accepts.code_id
state.accepts.code_id
end
state_table << { state_table << {
transition_table_index: transition_table.size, transition_table_index: transition_table.size,
n_transitions: state.transitions.size, n_transitions: state.transitions.size,

View File

@ -4,7 +4,7 @@ class Propane
# @return [Integer] # @return [Integer]
# ID of the RuleSet. # ID of the RuleSet.
attr_accessor :id attr_reader :id
# @return [String] # @return [String]
# Name of the RuleSet. # Name of the RuleSet.