Exception: SystemRDL::EvaluationError

Inherits:
Error
  • Object
show all
Defined in:
lib/systemrdl/error.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#error_message

Instance Method Summary collapse

Constructor Details

#initialize(message, *token_ranges) ⇒ EvaluationError

Returns a new instance of EvaluationError.



35
36
37
38
# File 'lib/systemrdl/error.rb', line 35

def initialize(message, *token_ranges)
  super(message)
  @token_ranges = token_ranges.compact
end

Instance Attribute Details

#token_rangesObject (readonly)

Returns the value of attribute token_ranges.



40
41
42
# File 'lib/systemrdl/error.rb', line 40

def token_ranges
  @token_ranges
end

Instance Method Details

#to_sObject



42
43
44
45
# File 'lib/systemrdl/error.rb', line 42

def to_s
  position = token_ranges.first&.head&.position
  (position && "#{super} -- #{position}") || super
end