def error(fn, msg, pos):
	if pos is None:
		return '%s: %s\n' % (fn, msg)
	
	col = len(pos[2][:pos[0][1]].replace('\t', ' ' * 4)) + 1
	desc = '%s [%s.%s]: %s' % (fn, pos[0][0] + 1, col, msg)
	if not pos[2]:
		return desc + '\n'
	
	line = pos[2].replace('\t', ' ' * 4).rstrip()
	spaces = pos[0][1] + 3 * min(pos[0][1], pos[2].count('\t'))
	return '\n'.join((desc, line, ' ' * spaces + '^')) + '\n'
Helper function to print useful error messages.
dataset/ETHPy150Open djc/runa/runac/util.py/error