Return a location message according to an observer.

Currently, if both are in the same file, the file information is not present in the result.

Property definitions

nitc $ Location :: relative_to
	# Return a location message according to an observer.
	#
	# Currently, if both are in the same file, the file information is not present in the result.
	fun relative_to(loc: nullable Location): String do
		var relative: Location
		if loc != null and loc.file == self.file then
			relative = new Location(null, self.line_start, self.line_end, self.column_start, self.column_end)
		else
			relative = new Location(self.file, self.line_start, self.line_end, self.column_start, self.column_end)
		end
		return relative.to_s
	end
src/location.nit:240,2--251,4