class Trenni::Location

def initialize(input, offset)

def initialize(input, offset)
	raise ArgumentError.new("Offset #{index} is past end of input #{input.bytesize}") if offset > input.bytesize
	
	@offset = offset
	@line_index = 0
	line_offset = next_line_offset = 0
	
	input.each_line do |line|
		line_offset = next_line_offset
		next_line_offset += line.bytesize
		
		# Is our input offset within this line?
		if next_line_offset >= offset
			@line_text = line.chomp
			@line_range = line_offset...next_line_offset
			break
		else
			@line_index += 1
		end
	end
end