#NEWLINE# @ memoize_default ( ) #NEWLINE# def _get_under_cursor_stmt( self , cursor_txt , start_pos = None ) : #NEWLINE# #INDENT# tokenizer = source_tokens ( tokenizer ) #NEWLINE# r = Parser ( self . _grammar , cursor_txt , tokenizer = tokenizer ) #NEWLINE# try : #NEWLINE# #INDENT# stmt = r . module . children [ ( - 2 ) ] . children [ 0 ] #NEWLINE# #UNINDENT# except ( AttributeError , IndexError ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# user_stmt = self . _parser . user_stmt ( ) #NEWLINE# if ( user_stmt is None ) : #NEWLINE# #INDENT# pos = ( start_pos or self . _pos ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pos = user_stmt . start_pos #NEWLINE# #UNINDENT# stmt . move ( ( pos [ 0 ] - 1 ) , pos [ 1 ] ) #NEWLINE# stmt . parent = self . _parser . user_scope ( ) #NEWLINE# return stmt