Exception: Calyx::Errors::DuplicateRule

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/calyx/errors.rb

Overview

Raised when a rule passed in via a context map conflicts with an existing rule in the grammar.

grammar = Calyx::Grammar.new do
  start :priority
  priority "(A)"
end

grammar.evaluate(priority: "(B)")
# => Calyx::Errors::DuplicateRule: :priority is already registered

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ DuplicateRule

Returns a new instance of DuplicateRule.



51
52
53
# File 'lib/calyx/errors.rb', line 51

def initialize(msg)
  super(":#{msg} is already registered")
end