Exception: Pione::Lang::UnboundError

Inherits:
BindingError show all
Defined in:
lib/pione/lang/lang-exception.rb

Overview

UnboundError is raised when unbound variable, rule, or package was referred.

Instance Method Summary collapse

Methods inherited from BindingError

#name

Constructor Details

#initialize(ref) ⇒ UnboundError

Returns a new instance of UnboundError.



103
104
105
# File 'lib/pione/lang/lang-exception.rb', line 103

def initialize(ref)
  @ref = ref
end

Instance Method Details

#messageObject



107
108
109
110
111
112
113
114
# File 'lib/pione/lang/lang-exception.rb', line 107

def message
  case @ref
  when Variable, RuleExpr
    "%s in package %s is unbound%s" % [name, @ref.package_id, @ref.pos.format]
  when PackageExpr
    "package &%s is unknown" % @ref.package_id
  end
end