Exception: OpenEHR::AQL::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/openehr/aql/errors.rb

Overview

Raised by the Lexer/Parser on malformed AQL source. Carries the 1-based line/column of the offending token so the message can point at the exact spot, e.g. "line 2, column 8: ...".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, line: nil, column: nil) ⇒ ParseError

Returns a new instance of ParseError.



14
15
16
17
18
19
# File 'lib/openehr/aql/errors.rb', line 14

def initialize(message, line: nil, column: nil)
  @line = line
  @column = column
  location = line && column ? " (line #{line}, column #{column})" : ''
  super("#{message}#{location}")
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



12
13
14
# File 'lib/openehr/aql/errors.rb', line 12

def column
  @column
end

#lineObject (readonly)

Returns the value of attribute line.



12
13
14
# File 'lib/openehr/aql/errors.rb', line 12

def line
  @line
end