Exception: Pione::Lang::StructuralError

Inherits:
LangError
  • Object
show all
Defined in:
lib/pione/lang/lang-exception.rb

Overview

StructuralError is raised when there is an unexpected expression in a model structure.

Instance Method Summary collapse

Constructor Details

#initialize(expected, pos) ⇒ StructuralError

Returns a new instance of StructuralError.



11
12
13
14
# File 'lib/pione/lang/lang-exception.rb', line 11

def initialize(expected, pos)
  @expected = expected
  @pos = pos
end

Instance Method Details

#messageObject



16
17
18
19
20
# File 'lib/pione/lang/lang-exception.rb', line 16

def message
  name = @expected.name
  pos = @pos.format
  "the expression should be %s(%s)" % [name, pos]
end