Commit 12c4f523 by Neil Booth Committed by Neil Booth

c-parse.in (_yylex): Remove CPP_BACKSLASH case.

	* c-parse.in (_yylex): Remove CPP_BACKSLASH case.
	* cp/spew.c: Similarly.
	* cpplex.c (_cpp_lex_token): Backslashes are now CPP_OTHER.
	* cppmacro.c (stringify_arg): Similarly.
	* cpplib.h (CPP_BACKSLASH): Delete.

From-SVN: r37182
parent 78e7629e
2000-11-01 Neil Booth <neilb@earthling.net>
* c-parse.in (_yylex): Remove CPP_BACKSLASH case.
* cp/spew.c: Similarly.
* cpplex.c (_cpp_lex_token): Backslashes are now CPP_OTHER.
* cppmacro.c (stringify_arg): Similarly.
* cpplib.h (CPP_BACKSLASH): Delete.
2000-10-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-10-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_strstr): New function. * builtins.c (expand_builtin_strstr): New function.
......
...@@ -3259,7 +3259,6 @@ _yylex () ...@@ -3259,7 +3259,6 @@ _yylex ()
/* These tokens should not survive translation phase 4. */ /* These tokens should not survive translation phase 4. */
case CPP_HASH: case CPP_HASH:
case CPP_PASTE: case CPP_PASTE:
case CPP_BACKSLASH:
error ("syntax error before '%s' token", NAME(last_token)); error ("syntax error before '%s' token", NAME(last_token));
goto retry; goto retry;
......
...@@ -361,10 +361,6 @@ read_token (t) ...@@ -361,10 +361,6 @@ read_token (t)
error ("syntax error before '#' token"); error ("syntax error before '#' token");
goto retry; goto retry;
case CPP_BACKSLASH:
error ("syntax error before '\\' token");
goto retry;
default: default:
abort (); abort ();
} }
......
...@@ -931,7 +931,7 @@ _cpp_lex_token (pfile, result) ...@@ -931,7 +931,7 @@ _cpp_lex_token (pfile, result)
result->type = CPP_QUERY; result->type = CPP_QUERY;
buffer->read_ahead = EOF; buffer->read_ahead = EOF;
if (c == '\\') if (c == '\\')
result->type = CPP_BACKSLASH; goto random_char;
else if (c != '?') else if (c != '?')
goto do_switch; goto do_switch;
} }
......
...@@ -116,7 +116,6 @@ struct htab; ...@@ -116,7 +116,6 @@ struct htab;
/* The remainder of the punctuation. Order is not significant. */ \ /* The remainder of the punctuation. Order is not significant. */ \
OP(CPP_SEMICOLON, ";") /* structure */ \ OP(CPP_SEMICOLON, ";") /* structure */ \
OP(CPP_ELLIPSIS, "...") \ OP(CPP_ELLIPSIS, "...") \
OP(CPP_BACKSLASH, "\\") \
OP(CPP_PLUS_PLUS, "++") /* increment */ \ OP(CPP_PLUS_PLUS, "++") /* increment */ \
OP(CPP_MINUS_MINUS, "--") \ OP(CPP_MINUS_MINUS, "--") \
OP(CPP_DEREF, "->") /* accessors */ \ OP(CPP_DEREF, "->") /* accessors */ \
......
...@@ -386,7 +386,7 @@ stringify_arg (pfile, arg) ...@@ -386,7 +386,7 @@ stringify_arg (pfile, arg)
dest = cpp_spell_token (pfile, token, dest); dest = cpp_spell_token (pfile, token, dest);
total_len = dest - start; total_len = dest - start;
if (token->type == CPP_BACKSLASH) if (token->type == CPP_OTHER && token->val.aux == '\\')
backslash_count++; backslash_count++;
else else
backslash_count = 0; backslash_count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment