@property<EOL><INDENT>def sections(self) -> List['<STR_LIT>']:<DEDENT>
sections = []  <EOL>sections_append = sections.append<EOL>type_to_spans = self._type_to_spans<EOL>lststr = self._lststr<EOL>ss, se = _span = self._span<EOL>type_spans = type_to_spans.setdefault('<STR_LIT>', [])<EOL>full_match = SECTIONS_FULLMATCH(self._shadow)<EOL>section_spans = full_match.spans('<STR_LIT>')<EOL>levels = [len(eq) for eq in full_match.captures('<STR_LIT>')]<EOL>if not type_spans:<EOL><INDENT>spans_append = type_spans.append<EOL>for current_index, (current_level, (s, e)) in enumerate(<EOL>zip(levels, section_spans), <NUM_LIT:1><EOL>):<EOL><INDENT>for section_index, section_level in enumerate(<EOL>levels[current_index:], current_index<EOL>):<EOL><INDENT>if current_level and section_level > current_level:<EOL><INDENT>e = section_spans[section_index][<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>span = [ss + s, ss + e]<EOL>spans_append(span)<EOL>sections_append(<EOL>Section(lststr, type_to_spans, span, '<STR_LIT>'))<EOL><DEDENT>return sections<EOL><DEDENT>span_tuple_to_span = {(s[<NUM_LIT:0>], s[<NUM_LIT:1>]): s for s in type_spans}.get<EOL>for current_index, (current_level, (s, e)) in enumerate(<EOL>zip(levels, section_spans), <NUM_LIT:1><EOL>):<EOL><INDENT>for section_index, section_level in enumerate(<EOL>levels[current_index:], current_index<EOL>):<EOL><INDENT>if current_level and section_level > current_level:<EOL><INDENT>e = section_spans[section_index][<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>s, e = ss + s, ss + e<EOL>old_span = span_tuple_to_span((s, e))<EOL>if old_span is None:<EOL><INDENT>span = [s, e]<EOL>insort(type_spans, span)<EOL><DEDENT>else:<EOL><INDENT>span = old_span<EOL><DEDENT>sections_append(Section(lststr, type_to_spans, span, '<STR_LIT>'))<EOL><DEDENT>return sections<EOL>
Return a list of section in current wikitext.

        The first section will always be the lead section, even if it is an
        empty string.