- 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 | PEEKC(c, p); | 2448 | PEEKC(c, p); |
| 2449 | if (c == '*') { | 2449 | if (c == '*') { |
| 2450 | p = parse_comment(p); | 2450 | p = parse_comment(p); |
| 2451 | goto redo_no_start; | 2451 | /* comments replaced by a blank */ |
| 2452 | tok = ' '; | ||
| 2453 | goto keep_tok_flags; | ||
| 2452 | } else if (c == '/') { | 2454 | } else if (c == '/') { |
| 2453 | p = parse_line_comment(p); | 2455 | p = parse_line_comment(p); |
| 2454 | goto redo_no_start; | 2456 | tok = ' '; |
| 2457 | goto keep_tok_flags; | ||
| 2455 | } else if (c == '=') { | 2458 | } else if (c == '=') { |
| 2456 | p++; | 2459 | p++; |
| 2457 | tok = TOK_A_DIV; | 2460 | tok = TOK_A_DIV; |
| @@ -2847,16 +2850,17 @@ static void macro_subst(TokenString *tok_str, Sym **nested_list, · 389 unmodified lines | |||
| 2847 | int t, ret, spc; | 2850 | int t, ret, spc; |
| 2848 | CValue cval; | 2851 | CValue cval; |
| 2849 | struct macro_level ml; | 2852 | struct macro_level ml; |
| 2853 | int force_blank; | ||
| 2850 | 2854 | ||
| 2851 | /* first scan for '##' operator handling */ | 2855 | /* first scan for '##' operator handling */ |
| 2852 | ptr = macro_str; | 2856 | ptr = macro_str; |
| 2853 | macro_str1 = macro_twosharps(ptr); | 2857 | macro_str1 = macro_twosharps(ptr); |
| 2854 | 2858 | ||
| 2855 | /* a ' ' after subst */ | ||
| 2856 | int append_space = 0; | ||
| 2857 | if (macro_str1) | 2859 | if (macro_str1) |
| 2858 | ptr = macro_str1; | 2860 | ptr = macro_str1; |
| 2859 | spc = 0; | 2861 | spc = 0; |
| 2862 | force_blank = 0; | ||
| 2863 | |||
| 2860 | while (1) { | 2864 | while (1) { |
| 2861 | /* NOTE: ptr == NULL can only happen if tokens are read from | 2865 | /* NOTE: ptr == NULL can only happen if tokens are read from |
| 2862 | file stream due to a macro function call */ | 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 | if (ret != 0) | 2896 | if (ret != 0) |
| 2893 | goto no_subst; | 2897 | goto no_subst; |
| 2894 | if (parse_flags & PARSE_FLAG_SPACES) | 2898 | if (parse_flags & PARSE_FLAG_SPACES) |
| 2895 | append_space = 1; | 2899 | force_blank = 1; |
| 2896 | } else { | 2900 | } else { |
| 2897 | no_subst: | 2901 | no_subst: |
| 2898 | if (append_space) { | 2902 | if (force_blank) { |
| 2899 | tok_str_add(tok_str, ' '); | 2903 | tok_str_add(tok_str, ' '); |
| 2900 | spc = 1; | 2904 | spc = 1; |
| 2901 | append_space = 0; | 2905 | force_blank = 0; |
| 2902 | } | 2906 | } |
| 2903 | if (!check_space(t, &spc)) | 2907 | if (!check_space(t, &spc)) |
| 2904 | tok_str_add2(tok_str, t, &cval); | 2908 | tok_str_add2(tok_str, t, &cval); |