Exception: Utopia::XNode::ScanError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/utopia/xnode/scanner.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, scanner) ⇒ ScanError

Returns a new instance of ScanError.



11
12
13
14
15
16
# File 'lib/utopia/xnode/scanner.rb', line 11

def initialize(message, scanner)
	@message = message
	
	@pos = scanner.pos
	@line = scanner.calculate_line_number
end

Instance Method Details

#to_sObject



18
19
20
21
22
23
24
# File 'lib/utopia/xnode/scanner.rb', line 18

def to_s
	if @line
		"Scan Error: #{@message} @ [#{@line[0]}:#{@line[2]}]: #{@line[4]}"
	else
		"Scan Error [#{@pos}]: #{@message}"
	end
end