indent.c (e95d1e3c93781f3d2b899756f9a6553551f191bb) indent.c (9522d0b0d2c9418330de71422a6b4688cb000de6)
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1985 Sun Microsystems, Inc.
5 * Copyright (c) 1976 Board of Trustees of the University of Illinois.
6 * Copyright (c) 1980, 1993
7 * The Regents of the University of California. All rights reserved.
8 *

--- 1015 unchanged lines hidden (view full) ---

1024 /* local variable */
1025 dec_ind = ps.local_decl_indent > 0 ? ps.local_decl_indent : i;
1026 tabs_to_var = (use_tabs ? ps.local_decl_indent > 0 : 0);
1027 }
1028 goto copy_id;
1029
1030 case funcname:
1031 case ident: /* got an identifier or constant */
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1985 Sun Microsystems, Inc.
5 * Copyright (c) 1976 Board of Trustees of the University of Illinois.
6 * Copyright (c) 1980, 1993
7 * The Regents of the University of California. All rights reserved.
8 *

--- 1015 unchanged lines hidden (view full) ---

1024 /* local variable */
1025 dec_ind = ps.local_decl_indent > 0 ? ps.local_decl_indent : i;
1026 tabs_to_var = (use_tabs ? ps.local_decl_indent > 0 : 0);
1027 }
1028 goto copy_id;
1029
1030 case funcname:
1031 case ident: /* got an identifier or constant */
1032 if (ps.in_decl) { /* if we are in a declaration, we must indent
1033 * identifier */
1034 if (type_code != funcname || !procnames_start_line) {
1035 if (!ps.block_init && !ps.dumped_decl_indent && ps.paren_level == 0) {
1036 if (troff) {
1037 if (ps.want_blank)
1038 *e_code++ = ' ';
1039 sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7);
1040 e_code += strlen(e_code);
1041 } else
1042 indent_declaration(dec_ind, tabs_to_var);
1043 ps.dumped_decl_indent = true;
1044 ps.want_blank = false;
1045 }
1046 } else {
1047 if (ps.want_blank && !(procnames_start_line &&
1048 type_code == funcname))
1049 *e_code++ = ' ';
1050 ps.want_blank = false;
1051 if (dec_ind && s_code != e_code) {
1032 if (ps.in_decl) {
1033 if (type_code == funcname) {
1034 ps.in_decl = false;
1035 if (procnames_start_line && s_code != e_code) {
1052 *e_code = '\0';
1053 dump_line();
1054 }
1036 *e_code = '\0';
1037 dump_line();
1038 }
1055 dec_ind = 0;
1039 else if (ps.want_blank) {
1040 *e_code++ = ' ';
1041 }
1042 ps.want_blank = false;
1056 }
1043 }
1044 else if (!ps.block_init && !ps.dumped_decl_indent &&
1045 ps.paren_level == 0) { /* if we are in a declaration, we
1046 * must indent identifier */
1047
1048 if (troff) {
1049 if (ps.want_blank)
1050 *e_code++ = ' ';
1051 sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7);
1052 e_code += strlen(e_code);
1053 } else
1054 indent_declaration(dec_ind, tabs_to_var);
1055 ps.dumped_decl_indent = true;
1056 ps.want_blank = false;
1057 }
1057 }
1058 else if (sp_sw && ps.p_l_follow == 0) {
1059 sp_sw = false;
1060 force_nl = true;
1061 ps.last_u_d = true;
1062 ps.in_stmt = false;
1063 parse(hd_type);
1064 }

--- 292 unchanged lines hidden ---
1058 }
1059 else if (sp_sw && ps.p_l_follow == 0) {
1060 sp_sw = false;
1061 force_nl = true;
1062 ps.last_u_d = true;
1063 ps.in_stmt = false;
1064 parse(hd_type);
1065 }

--- 292 unchanged lines hidden ---