def parse_glob(pattern):
if not pattern:<EOL><INDENT>return<EOL><DEDENT>bits = pattern.split("<STR_LIT:/>")<EOL>dirs, filename = bits[:-<NUM_LIT:1>], bits[-<NUM_LIT:1>]<EOL>for dirname in dirs:<EOL><INDENT>if dirname == "<STR_LIT>":<EOL><INDENT>yield  "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>yield glob2re(dirname) + "<STR_LIT:/>"<EOL><DEDENT><DEDENT>yield glob2re(filename)<EOL>
Generate parts of regex transformed from glob pattern.