History

Replace comment by a blank

- 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

Changming Xu committed 15 years ago

Commit 68472341 parent 185fba41 file · +11 −7Browse files

Unified · Split

tccpp.c+11−7
@@ -2448,10 +2448,13 @@ maybe_newline: · 2447 unmodified lines
24482448 PEEKC(c, p);
24492449 if (c == '*') {
24502450 p = parse_comment(p);
2451− goto redo_no_start;
2451+ /* comments replaced by a blank */
2452+ tok = ' ';
2453+ goto keep_tok_flags;
24522454 } else if (c == '/') {
24532455 p = parse_line_comment(p);
2454− goto redo_no_start;
2456+ tok = ' ';
2457+ goto keep_tok_flags;
24552458 } else if (c == '=') {
24562459 p++;
24572460 tok = TOK_A_DIV;
@@ -2847,16 +2850,17 @@ static void macro_subst(TokenString *tok_str, Sym **nested_list, · 389 unmodified lines
28472850 int t, ret, spc;
28482851 CValue cval;
28492852 struct macro_level ml;
2853+ int force_blank;
28502854
28512855 /* first scan for '##' operator handling */
28522856 ptr = macro_str;
28532857 macro_str1 = macro_twosharps(ptr);
28542858
2855− /* a ' ' after subst */
2856− int append_space = 0;
28572859 if (macro_str1)
28582860 ptr = macro_str1;
28592861 spc = 0;
2862+ force_blank = 0;
2863+
28602864 while (1) {
28612865 /* NOTE: ptr == NULL can only happen if tokens are read from
28622866 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
28922896 if (ret != 0)
28932897 goto no_subst;
28942898 if (parse_flags & PARSE_FLAG_SPACES)
2895− append_space = 1;
2899+ force_blank = 1;
28962900 } else {
28972901 no_subst:
2898− if (append_space) {
2902+ if (force_blank) {
28992903 tok_str_add(tok_str, ' ');
29002904 spc = 1;
2901− append_space = 0;
2905+ force_blank = 0;
29022906 }
29032907 if (!check_space(t, &spc))
29042908 tok_str_add2(tok_str, t, &cval);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t