- fix my prev commit: put declaration above statements to stay c89 compatible - replace commit by a blank #define con(a, b) a/**/b this should yield a b, not ab
Unified · Split
| @@ -2448,10 +2448,13 @@ maybe_newline: · 2447 unmodified lines | ||
| 2448 | 2448 | PEEKC(c, p); |
| 2449 | 2449 | if (c == '*') { |
| 2450 | 2450 | p = parse_comment(p); |
| 2451 | − goto redo_no_start; | |
| 2451 | + /* comments replaced by a blank */ | |
| 2452 | + tok = ' '; | |
| 2453 | + goto keep_tok_flags; | |
| 2452 | 2454 | } else if (c == '/') { |
| 2453 | 2455 | p = parse_line_comment(p); |
| 2454 | − goto redo_no_start; | |
| 2456 | + tok = ' '; | |
| 2457 | + goto keep_tok_flags; | |
| 2455 | 2458 | } else if (c == '=') { |
| 2456 | 2459 | p++; |
| 2457 | 2460 | tok = TOK_A_DIV; |
| @@ -2847,16 +2850,17 @@ static void macro_subst(TokenString *tok_str, Sym **nested_list, · 389 unmodified lines | ||
| 2847 | 2850 | int t, ret, spc; |
| 2848 | 2851 | CValue cval; |
| 2849 | 2852 | struct macro_level ml; |
| 2853 | + int force_blank; | |
| 2850 | 2854 | |
| 2851 | 2855 | /* first scan for '##' operator handling */ |
| 2852 | 2856 | ptr = macro_str; |
| 2853 | 2857 | macro_str1 = macro_twosharps(ptr); |
| 2854 | 2858 | |
| 2855 | − /* a ' ' after subst */ | |
| 2856 | − int append_space = 0; | |
| 2857 | 2859 | if (macro_str1) |
| 2858 | 2860 | ptr = macro_str1; |
| 2859 | 2861 | spc = 0; |
| 2862 | + force_blank = 0; | |
| 2863 | + | |
| 2860 | 2864 | while (1) { |
| 2861 | 2865 | /* NOTE: ptr == NULL can only happen if tokens are read from |
| 2862 | 2866 | file stream due to a macro function call */ |
| @@ -2892,13 +2896,13 @@ static void macro_subst(TokenString *tok_str, Sym **nested_list, · 29 unmodified lines | ||
| 2892 | 2896 | if (ret != 0) |
| 2893 | 2897 | goto no_subst; |
| 2894 | 2898 | if (parse_flags & PARSE_FLAG_SPACES) |
| 2895 | − append_space = 1; | |
| 2899 | + force_blank = 1; | |
| 2896 | 2900 | } else { |
| 2897 | 2901 | no_subst: |
| 2898 | − if (append_space) { | |
| 2902 | + if (force_blank) { | |
| 2899 | 2903 | tok_str_add(tok_str, ' '); |
| 2900 | 2904 | spc = 1; |
| 2901 | − append_space = 0; | |
| 2905 | + force_blank = 0; | |
| 2902 | 2906 | } |
| 2903 | 2907 | if (!check_space(t, &spc)) |
| 2904 | 2908 | tok_str_add2(tok_str, t, &cval); |