#NEWLINE# def _parse_element( source , info ) : #NEWLINE# #INDENT# here = source . pos #NEWLINE# ch = source . get ( ) #NEWLINE# if ( ch in SPECIAL_CHARS ) : #NEWLINE# #INDENT# if ( ch in ')|' ) : #NEWLINE# #INDENT# source . pos = here #NEWLINE# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '\\' ) : #NEWLINE# #INDENT# return _parse_escape ( source , info , in_set = False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '(' ) : #NEWLINE# #INDENT# element = _parse_paren ( source , info ) #NEWLINE# if ( element is not None ) : #NEWLINE# #INDENT# return element #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '.' ) : #NEWLINE# #INDENT# if ( info . flags & DOT_ALL ) : #NEWLINE# #INDENT# return AnyAll ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return Any ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '[' ) : #NEWLINE# #INDENT# return _parse_set ( source , info ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '^' ) : #NEWLINE# #INDENT# return AtPosition ( AT_BEGINNING_STRING ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == '$' ) : #NEWLINE# #INDENT# return AtPosition ( AT_END_STRING ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( counts == '{' ) : #NEWLINE# #INDENT# here2 = source . pos #NEWLINE# counts = _parse_quantifier ( source , info ) #NEWLINE# if ( counts is not None ) : #NEWLINE# #INDENT# raise RegexpError ( 'nothing to repeat' ) #NEWLINE# #UNINDENT# source . pos = here2 #NEWLINE# return make_character ( info , ord ( ch [ 0 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch in '?*+' ) : #NEWLINE# #INDENT# raise RegexpError ( 'nothing to repeat' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return make_character ( info , ord ( ch [ 0 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return make_character ( info , ord ( ch [ 0 ] ) )