#NEWLINE# def HandleAfterToken( self , token ) : #NEWLINE# #INDENT# 'Handle updating state after a token has been checked.\n\n    This function should be used for destructive state changes such as\n    deleting a tracked object.\n\n    Args:\n      token: The token to handle.\n    ' #NEWLINE# type = token . type #NEWLINE# if ( ( type == Type . SEMICOLON ) or ( type == Type . END_PAREN ) or ( ( type == Type . END_BRACKET ) and ( self . _last_non_space_token . type not in ( Type . SINGLE_QUOTE_STRING_END , Type . DOUBLE_QUOTE_STRING_END ) ) ) ) : #NEWLINE# #INDENT# self . _doc_comment = None #NEWLINE# self . _last_comment = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type == Type . END_BLOCK ) : #NEWLINE# #INDENT# self . _doc_comment = None #NEWLINE# self . _last_comment = None #NEWLINE# if ( self . InFunction ( ) and self . IsFunctionClose ( ) ) : #NEWLINE# #INDENT# function = self . _function_stack . pop ( ) #NEWLINE# function . end_token = token #NEWLINE# while ( self . _variables_in_scope and self . _variables_in_scope [ ( - 1 ) ] ) : #NEWLINE# #INDENT# self . _variables_in_scope . pop ( ) #NEWLINE# #UNINDENT# if self . _variables_in_scope : #NEWLINE# #INDENT# self . _variables_in_scope . pop ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( token == Type . END_PARAMETERS ) and self . _doc_comment ) : #NEWLINE# #INDENT# self . _doc_comment = None #NEWLINE# self . _last_comment = None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not token . IsAnyType ( Type . WHITESPACE , Type . BLANK_LINE ) ) : #NEWLINE# #INDENT# self . _last_non_space_token = token #NEWLINE# #UNINDENT# self . _last_line = token . line