def parse_dunder_all(self):
assert self.current.value == '<STR_LIT>'<EOL>self.consume(tk.NAME)<EOL>if self.dunder_all is not None or self.dunder_all_error is not None:<EOL><INDENT>self.dunder_all = None<EOL>self.dunder_all_error = '<STR_LIT>'<EOL>return<EOL><DEDENT>if self.current.value != '<STR_LIT:=>':<EOL><INDENT>self.dunder_all_error = '<STR_LIT>'<EOL>return<EOL><DEDENT>self.consume(tk.OP)<EOL>is_surrounded = False<EOL>if self.current.value in '<STR_LIT>':<EOL><INDENT>is_surrounded = True<EOL>self.consume(tk.OP)<EOL><DEDENT>dunder_all_content = "<STR_LIT:(>"<EOL>while True:<EOL><INDENT>if is_surrounded and self.current.value in "<STR_LIT>":<EOL><INDENT>break<EOL><DEDENT>if self.current.kind in (tk.NEWLINE, tk.ENDMARKER):<EOL><INDENT>break<EOL><DEDENT>if self.current.kind in (tk.NL, tk.COMMENT):<EOL><INDENT>pass<EOL><DEDENT>elif (self.current.kind == tk.STRING or self.current.value == '<STR_LIT:U+002C>'):<EOL><INDENT>dunder_all_content += self.current.value<EOL><DEDENT>else:<EOL><INDENT>self.dunder_all_error = '<STR_LIT>'<EOL>return<EOL><DEDENT>self.stream.move()<EOL><DEDENT>if is_surrounded:<EOL><INDENT>self.consume(tk.OP)<EOL><DEDENT>if not is_surrounded and '<STR_LIT:U+002C>' not in dunder_all_content:<EOL><INDENT>self.dunder_all_error = (<EOL>'<STR_LIT>'<EOL>.format(self.current.kind))<EOL>return<EOL><DEDENT>dunder_all_content += "<STR_LIT:)>"<EOL>try:<EOL><INDENT>self.dunder_all = eval(dunder_all_content, {})<EOL><DEDENT>except BaseException as e:<EOL><INDENT>self.dunder_all_error = (<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(dunder_all_content, e))<EOL><DEDENT>while (self.current.kind not in self.stream.LOGICAL_NEWLINES and<EOL>self.current.kind != tk.ENDMARKER):<EOL><INDENT>if self.current.kind != tk.COMMENT:<EOL><INDENT>self.dunder_all = None<EOL>self.dunder_all_error = '<STR_LIT>'<EOL>return<EOL><DEDENT><DEDENT>
Parse the __all__ definition in a module.