def parse(self, string, name='<STR_LIT>'):
string = string.expandtabs()<EOL>min_indent = self._min_indent(string)<EOL>if min_indent > <NUM_LIT:0>:<EOL><INDENT>string = '<STR_LIT:\n>'.join([l[min_indent:] for l in string.split('<STR_LIT:\n>')])<EOL><DEDENT>output = []<EOL>charno, lineno = <NUM_LIT:0>, <NUM_LIT:0><EOL>for m in self._EXAMPLE_RE.finditer(string):<EOL><INDENT>output.append(string[charno:m.start()])<EOL>lineno += string.count('<STR_LIT:\n>', charno, m.start())<EOL>(source, options, want, exc_msg) =self._parse_example(m, name, lineno)<EOL>if not self._IS_BLANK_OR_COMMENT(source):<EOL><INDENT>output.append( Example(source, want, exc_msg,<EOL>lineno=lineno,<EOL>indent=min_indent+len(m.group('<STR_LIT>')),<EOL>options=options) )<EOL><DEDENT>lineno += string.count('<STR_LIT:\n>', m.start(), m.end())<EOL>charno = m.end()<EOL><DEDENT>output.append(string[charno:])<EOL>return output<EOL>
Divide the given string into examples and intervening text,
and return them as a list of alternating Examples and strings.
Line numbers for the Examples are 0-based.  The optional
argument `name` is a name identifying this string, and is only
used for error messages.