Lines Matching +defs:token +defs:code
14 * 1. Redistributions of source code must retain the above copyright
75 struct buffer token;
78 struct buffer code;
333 buf_add_char(&code, ' ');
334 buf_add_buf(&code, &com);
343 ps.lbrace_kind = token.s[0] == 's' ? psym_lbrace_struct :
344 token.s[0] == 'u' ? psym_lbrace_union :
374 int ind = ind_add(base, code.s, code.len);
376 size_t orig_code_len = code.len;
380 buf_add_char(&code, '\t');
382 buf_add_char(&code, ' ');
383 if (code.len == orig_code_len && ps.want_blank)
384 buf_add_char(&code, ' ');
526 if (lab.len > 0 || code.len > 0 || com.len > 0)
615 buf_add_char(&code, ' ');
617 buf_add_buf(&code, &token);
637 paren_stack_push(&ps.paren, ind_add(0, code.s, code.len), cast);
658 diag(0, "Extra '%c'", *token.s);
669 if (code.len == 0)
672 buf_add_buf(&code, &token);
694 if (code.len > 0
696 buf_add_char(&code, ' ');
697 buf_add_buf(&code, &token);
700 paren_stack_push(&ps.paren, ind_add(0, code.s, code.len), cast_no);
707 diag(0, "Extra '%c'", *token.s);
711 if (code.len == 0)
714 buf_add_buf(&code, &token);
736 if (code.len > 0 && !ps.in_init) {
738 (code.len > 0 && code.s[code.len - 1] == '}'))
759 if (code.len == 0)
778 buf_add_char(&code, ' ');
780 buf_add_char(&code, '{');
799 if (code.len > 0 && !ps.in_init)
802 buf_add_char(&code, '}');
831 if (code.len > 0 && code.s[code.len - 1] == ',')
832 buf_add_char(&code, ' ');
833 buf_add_char(&code, '.');
841 int ind = ps.decl_ind - (int)token.len;
843 } else if ((token.s[0] == '+' || token.s[0] == '-')
844 && code.len > 0 && code.s[code.len - 1] == token.s[0])
848 buf_add_char(&code, ' ');
849 buf_add_buf(&code, &token);
856 buf_add_buf(&code, &token);
863 ps.want_blank = code.len > 0; /* only put blank after comma if comma
872 buf_add_char(&code, ',');
879 ind_add(compute_code_indent(), code.s, code.len)
888 buf_add_buf(&lab, &code);
890 buf_clear(&code);
903 buf_add_char(&code, ':');
924 if (ps.in_decl && code.len == 0 && !ps.in_init &&
942 buf_add_char(&code, ';');
958 if (ps.prev_lsym == lsym_rparen && ps.psyms.len <= 2 && code.len > 0)
977 int ind0 = code.len > 0 ? ind_add(0, code.s, code.len) + 1 : 0;
978 ps.decl_ind = ind_add(ind0, token.s, token.len) + 1;
995 && code.len > (*in.p == ')' ? 1 : 0))
998 buf_add_char(&code, ' ');
1005 && code.len > 0 && code.s[code.len - 1] == '}')
1006 ps.decl_ind = ind_add(0, code.s, code.len) + 1;
1025 if (code.len > 0)
1038 if (code.len > 0
1039 && !(opt.cuddle_else && code.s[code.len - 1] == '}'))
1100 buf_add_char(&code, ' ');
1101 buf_add_buf(&code, &token);
1120 debug_printf("line %s:%d: next token is %s",
1122 debug_print_buf("with text", &token);
1124 if (lab.len > 0 || code.len > 0 || com.len > 0)