lib/lrama/grammar/parameterizing_rule/rule.rb in lrama-0.6.9 vs lib/lrama/grammar/parameterizing_rule/rule.rb in lrama-0.6.10
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Lrama
class Grammar
class ParameterizingRule
class Rule
attr_reader :name, :parameters, :rhs_list, :required_parameters_count, :tag, :is_inline
@@ -9,9 +11,13 @@
@parameters = parameters
@rhs_list = rhs_list
@tag = tag
@is_inline = is_inline
@required_parameters_count = parameters.count
+ end
+
+ def to_s
+ "#{@name}(#{@parameters.map(&:s_value).join(', ')})"
end
end
end
end
end