Exception: Calyx::Errors::MissingRule

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

Overview

Only rules that exist in the registry can be evaluated. When a non-existent rule is referenced, this error is raised.

grammar = Calyx::Grammar.new do
  start :blank
end

grammar.evaluate
# => Calyx::Errors::MissingRule: :blank is not registered

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ MissingRule

Returns a new instance of MissingRule.



14
15
16
# File 'lib/calyx/errors.rb', line 14

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