Exception: CArray::JIT::Unsupported

Inherits:
Error
  • Object
show all
Defined in:
lib/carray/jit/errors.rb

Overview

Raised when a kernel falls outside the recognized subset. Callers that want the Ruby evaluator instead of a hard failure rescue this.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, location = nil) ⇒ Unsupported

Returns a new instance of Unsupported.

Parameters:

  • message (String) —

    what was refused.

  • location (Prism::Location, nil) (defaults to: nil) —

    where it is in the block; when given, the line and column are appended to the message.



19
20
21
22
23
24
25
26
# File 'lib/carray/jit/errors.rb', line 19

def initialize (message, location = nil)
  @location = location
  if location
    super("#{message} (at line #{location.start_line}, column #{location.start_column})")
  else
    super(message)
  end
end

Instance Attribute Details

#location ⇒ Prism::Location? (readonly)

Returns where in the block the construct is, or nil when the message names no place.

Returns:

  • (Prism::Location, nil) —

    where in the block the construct is, or nil when the message names no place.



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

def location
  @location
end