Exception: Ryac::SyntaxError

Inherits:
InputError show all
Defined in:
lib/ryac/errors.rb,
sig/ryac/errors.rbs

Overview

The input does not parse. Carries the coordinates of the first error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, path: nil, line: nil, column: nil) ⇒ SyntaxError

Returns a new instance of SyntaxError.

Parameters:

  • message (String)
  • path: (String, nil) (defaults to: nil)
  • line: (Integer, nil) (defaults to: nil)
  • column: (Integer, nil) (defaults to: nil)


24
25
26
27
28
29
30
# File 'lib/ryac/errors.rb', line 24

def initialize(message, path: nil, line: nil, column: nil)
  @path = path
  @line = line
  @column = column
  message = "#{path}:#{line}:#{column}: #{message}" if path
  super(message)
end

Instance Attribute Details

#column ⇒ Integer? (readonly)

Returns the value of attribute column.

Returns:

  • (Integer, nil)


22
23
24
# File 'lib/ryac/errors.rb', line 22

def column
  @column
end

#line ⇒ Integer? (readonly)

Returns the value of attribute line.

Returns:

  • (Integer, nil)


22
23
24
# File 'lib/ryac/errors.rb', line 22

def line
  @line
end

#path ⇒ String? (readonly)

Returns the value of attribute path.

Returns:

  • (String, nil)


22
23
24
# File 'lib/ryac/errors.rb', line 22

def path
  @path
end