def parse_flags(*flags, **kwargs):
parsed = {<EOL>'<STR_LIT>':       OrderedSet(),<EOL>'<STR_LIT>':        OrderedSet(),<EOL>'<STR_LIT>':       OrderedSet(),<EOL>'<STR_LIT>':      OrderedSet(),<EOL>'<STR_LIT>':    OrderedSet(),<EOL>'<STR_LIT>': OrderedSet(),<EOL>'<STR_LIT>':       OrderedSet(),<EOL>'<STR_LIT>':          OrderedSet(),<EOL>'<STR_LIT>':       OrderedSet(),<EOL>}<EOL>def _parse(arg):<EOL><INDENT>if not arg:<EOL><INDENT>return<EOL><DEDENT>if not isinstance(arg, STR_TYPES):<EOL><INDENT>for item in arg:<EOL><INDENT>_parse(arg)<EOL><DEDENT>return<EOL><DEDENT>def add_define(name):<EOL><INDENT>part = name.split('<STR_LIT:=>')<EOL>if len(part) == <NUM_LIT:1>:<EOL><INDENT>parsed['<STR_LIT>'].add(name)<EOL><DEDENT>else:<EOL><INDENT>parsed['<STR_LIT>'].add([part[<NUM_LIT:0>], '<STR_LIT:=>'.join(part[<NUM_LIT:1>:])])<EOL><DEDENT><DEDENT>part = shlex.split(arg)<EOL>curr = None   <EOL>for item in part:<EOL><INDENT>if curr is not None:<EOL><INDENT>if curr == '<STR_LIT>':<EOL><INDENT>add_define(item)<EOL><DEDENT>elif curr == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(('<STR_LIT>', item))<EOL><DEDENT>elif curr == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(('<STR_LIT>', item))<EOL>parsed['<STR_LIT>'].add(('<STR_LIT>', item))<EOL><DEDENT>elif curr == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(('<STR_LIT>', item))<EOL>parsed['<STR_LIT>'].add(('<STR_LIT>', item))<EOL><DEDENT>else:<EOL><INDENT>parsed[curr].add(item)<EOL><DEDENT>curr = None<EOL><DEDENT>elif not item[<NUM_LIT:0>] in '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL>curr = '<STR_LIT>'<EOL><DEDENT>elif item[:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>if item[<NUM_LIT:2>:]:<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif item[:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>if item[<NUM_LIT:2>:]:<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif item[:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>if item[<NUM_LIT:2>:]:<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif item[:<NUM_LIT:4>] == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(arg[<NUM_LIT:4>:])<EOL>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item[:<NUM_LIT:4>] == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item[:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>if item[<NUM_LIT:2>:]:<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif item == '<STR_LIT>':<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT>elif item[:<NUM_LIT>] == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT>:])<EOL><DEDENT>elif item[:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>if item[<NUM_LIT:2>:]:<EOL><INDENT>parsed['<STR_LIT>'].add(item[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>curr = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif item in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item[:<NUM_LIT:5>] == '<STR_LIT>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item[<NUM_LIT:0>] == '<STR_LIT:+>':<EOL><INDENT>parsed['<STR_LIT>'].add(item)<EOL>parsed['<STR_LIT>'].add(item)<EOL><DEDENT>elif item in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>curr = item<EOL><DEDENT>else:<EOL><INDENT>parsed[kwargs.get('<STR_LIT>', '<STR_LIT>')].add(item)<EOL><DEDENT><DEDENT><DEDENT>for arg in flags:<EOL><INDENT>_parse(arg)<EOL><DEDENT>return parsed<EOL>
Parse compile flags.