lib/lrama/context.rb in lrama-0.5.6 vs lib/lrama/context.rb in lrama-0.5.7

- old
+ new

@@ -168,11 +168,11 @@ end return a end - # Mapping from rule number to lenght of RHS. + # Mapping from rule number to length of RHS. # Dummy rule is appended as the first element whose value is 0 # because 0 means error in yydefact. def yyr2 a = [0] @@ -212,11 +212,11 @@ # and reduce is represented as minus number. def rule_id_to_action_number(rule_id) (rule_id + 1) * -1 end - # Symbol number is assinged to term first then nterm. + # Symbol number is assigned to term first then nterm. # This method calculates sequence_number for nterm. def nterm_number_to_sequence_number(nterm_number) nterm_number - @states.terms.count end @@ -257,11 +257,11 @@ conflict.which == :error end.each do |conflict| actions[conflict.symbol.number] = ErrorActionNumber end - # If default_reduction_rule, replase default_reduction_rule in + # If default_reduction_rule, replace default_reduction_rule in # actions with zero. if state.default_reduction_rule actions.map! do |e| if e == rule_id_to_action_number(state.default_reduction_rule.id) 0 @@ -270,10 +270,10 @@ end end end # If no default_reduction_rule, default behavior is an - # error then replase ErrorActionNumber with zero. + # error then replace ErrorActionNumber with zero. if !state.default_reduction_rule actions.map! do |e| if e == ErrorActionNumber 0 else