def cap_list(caps):
out = []<EOL>caps = caps.split()<EOL>for cap in caps:<EOL><INDENT>mods = []<EOL>while len(cap) > <NUM_LIT:0> and cap[<NUM_LIT:0>] in cap_modifiers:<EOL><INDENT>attr = cap[<NUM_LIT:0>]<EOL>cap = cap[<NUM_LIT:1>:]<EOL>mods.append(cap_modifiers[attr])<EOL><DEDENT>if '<STR_LIT:=>' in cap:<EOL><INDENT>cap, value = cap.rsplit('<STR_LIT:=>', <NUM_LIT:1>)<EOL>if value and cap.casefold() in ['<STR_LIT>']:<EOL><INDENT>value = CaseInsensitiveList(value.split('<STR_LIT:U+002C>'))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>value = None<EOL><DEDENT>out.append([cap, value, mods])<EOL><DEDENT>return out<EOL>
Given a cap string, return a list of cap, value.