def format_error(msg, row=None, col=None, line=None):
	"""
	Format the error for human consumption.
	"""

	if row is None or col is None or line is None:
		return 'error: {0}'.format(msg)
	else:
		return 'error: {0} at column {1} on line {2}:\n{3}{4}\n{5}^'.format(msg,
				col, row, ' ' * 2, line, ' ' * (col + 1))