def compute_prev(before, block, idx, after):
	"""
	Get the token just before the gap before block[idx] (inspecting inside lists)
	"""
	if idx == 0:
		return before
	else:
		prev = block[idx-1]
		if type(prev) == list:
			if not prev:
				return compute_prev(before, block, idx-1, after)
			return prev[-1]
		return prev