Class SDL4R::SdlParseError

  1. lib/sdl4r/sdl_parse_error.rb
Parent: StandardError

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

Methods

public class

  1. new

Attributes

line [R]
position [R]

Public class methods

new (description, line_no, position, line = nil)

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

[show source]
    # File lib/sdl4r/sdl_parse_error.rb, line 36
36:                 def initialize(description, line_no, position, line = nil)
37:                         super(
38:                                 "#{description} Line " + ((line_no.nil? or line_no < 0)? "unknown" : line_no.to_s) +
39:                                         ", Position " + ((position.nil? or position < 0)? "unknown" : position.to_s) + $/ +
40:           ((line and position >= 0)? line + (position ? " " * (position - 1) : "") + "^" : ""))
41:           
42:                         @line = line_no
43:                         @position = position
44:                 end