def handle_start_block(self, token_text):
    self.set_mode(MODE.BlockStatement)
    empty_braces = self.is_next('}')
    empty_anonymous_function = (empty_braces and (self.flags.last_word == 'function') and (self.last_type == 'TK_END_EXPR'))
    if (self.opts.brace_style == 'expand'):
        if ((self.last_type != 'TK_OPERATOR') and (empty_anonymous_function or (self.last_type == 'TK_EQUALS') or ((self.last_type == 'TK_RESERVED') and self.is_special_word(self.flags.last_text) and (self.flags.last_text != 'else')))):
            self.output_space_before_token = True
        else:
            self.append_newline(preserve_statement_flags=True)
    elif (self.last_type not in ['TK_OPERATOR', 'TK_START_EXPR']):
        if (self.last_type == 'TK_START_BLOCK'):
            self.append_newline()
        else:
            self.output_space_before_token = True
    elif (self.is_array(self.previous_flags.mode) and (self.flags.last_text == ',')):
        if (self.last_last_text == '}'):
            self.output_space_before_token = True
        else:
            self.append_newline()
    self.append_token(token_text)
    self.indent()
def handle_start_block(self, token_text):
    self.set_mode(MODE.BlockStatement)
    empty_braces = self.is_next('}')
    empty_anonymous_function = (empty_braces and (self.flags.last_word == 'function') and (self.last_type == 'TK_END_EXPR'))
    if (self.opts.brace_style == 'expand'):
        if ((self.last_type != 'TK_OPERATOR') and (empty_anonymous_function or (self.last_type == 'TK_EQUALS') or ((self.last_type == 'TK_RESERVED') and self.is_special_word(self.flags.last_text) and (self.flags.last_text != 'else')))):
            self.output_space_before_token = True
        else:
            self.append_newline(preserve_statement_flags=True)
    elif (self.last_type not in ['TK_OPERATOR', 'TK_START_EXPR']):
        if (self.last_type == 'TK_START_BLOCK'):
            self.append_newline()
        else:
            self.output_space_before_token = True
    elif (self.is_array(self.previous_flags.mode) and (self.flags.last_text == ',')):
        if (self.last_last_text == '}'):
            self.output_space_before_token = True
        else:
            self.append_newline()
    self.append_token(token_text)
    self.indent()