def get_conversion_points(s):
	"""
	Returns a list of tuples of (startpoint, endpoint, cmd, arg)
	s[startpoint:endpoint] is the entire identified command.

	Uses a simple state machine to parse the string. This could also have
	been done with regexs, but this is faster and easy to make handle
	things like optional arguments.
	"""
	rv = []
	pos = 0
	while pos < len(s):
		if s[pos] == '\\': #All commands start with a \
			repstart = pos
			pos += 1
			cmd = s[pos] #All accent commands are single character names
			pos = pos + 1
			if s[pos] == '{': #{ } are optional for the argument
				pos += 1
				arg = ""
				while s[pos] != '}':
					arg += s[pos] #Build 'arg' as the contents of the { }
					pos += 1
			else:
				arg = s[pos] #If { } were not used, 'arg' is the next char
			repend = pos
			rv.append((repstart, repend, cmd, arg))
		pos = pos + 1
	return rv