Class SDL4R::SdlParseError
In: lib/sdl4r/sdl_parse_error.rb
Parent: StandardError

An exception describing a problem with an SDL document‘s structure

Methods

new  

Attributes

line  [R] 
position  [R] 

Public Class methods

Note: Line and positioning numbering start with 1 rather than 0 to be consistent with most editors.

description A description of the problem. lineNo The line on which the error occured or -1 for unknown position The position (within the line) where the error occured or -1 for unknown

[Source]

# File lib/sdl4r/sdl_parse_error.rb, line 36
                def initialize(description, line_no, position, line = nil)
                        super(
                                "#{description} Line " + ((line_no.nil? or line_no < 0)? "unknown" : line_no.to_s) +
                                        ", Position " + ((position.nil? or position < 0)? "unknown" : position.to_s) + "\n" +
          (line ? line + (position ? " " * (position - 1) : "") + "^" : ""))
          
                        @lineNo = line_no
                        @position = position
                end

[Validate]