aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorTom Wood <wood@gnu.org>1992-07-01 12:58:09 +0000
committerTom Wood <wood@gnu.org>1992-07-01 12:58:09 +0000
commita3100298b45f4e059f519c7e675330130c035ef0 (patch)
treec6909f7341d467275d2b569db10ee820a9792648 /gcc/c-lex.c
parent207f835880ce6053a22e5029d2b5449af5dfeaf4 (diff)
downloadgcc-a3100298b45f4e059f519c7e675330130c035ef0.zip
gcc-a3100298b45f4e059f519c7e675330130c035ef0.tar.gz
gcc-a3100298b45f4e059f519c7e675330130c035ef0.tar.bz2
Undo rcs botch
From-SVN: r1370
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c55
1 files changed, 27 insertions, 28 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 75a7f4d..8d91eb1 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -482,13 +482,7 @@ check_newline ()
&& ((c = getc (finput)) == ' ' || c == '\t' || c == '\n'))
{
#ifdef HANDLE_SYSV_PRAGMA
- c = handle_sysv_pragma (finput, c);
- if (c >= 0)
- ;
- else if (nextchar >= 0)
- c = nextchar, nextchar = -1;
- else
- c = getc (finput);
+ return handle_sysv_pragma (finput, c);
#endif /* HANDLE_SYSV_PRAGMA */
#ifdef HANDLE_PRAGMA
HANDLE_PRAGMA (finput);
@@ -741,9 +735,8 @@ linenum:
#ifdef HANDLE_SYSV_PRAGMA
/* Handle a #pragma directive. INPUT is the current input stream,
- and C is a character to reread.
- Returns a character for the caller to reread,
- or -1 meaning there isn't one. */
+ and C is a character to reread. Processes the entire input line
+ and returns a character for the caller to reread: either \n or EOF. */
/* This function has to be in this file, in order to get at
the token types. */
@@ -753,26 +746,32 @@ handle_sysv_pragma (input, c)
FILE *input;
int c;
{
- while (c == ' ' || c == '\t')
- c = getc (input);
- if (c == '\n' || c == EOF)
- {
- handle_pragma_token (0, 0);
- return c;
- }
- ungetc (c, input);
- switch (yylex ())
+ for (;;)
{
- case IDENTIFIER:
- case TYPENAME:
- case STRING:
- case CONSTANT:
- handle_pragma_token (token_buffer, yylval.ttype);
- break;
- default:
- handle_pragma_token (token_buffer, 0);
+ while (c == ' ' || c == '\t')
+ c = getc (input);
+ if (c == '\n' || c == EOF)
+ {
+ handle_pragma_token (0, 0);
+ return c;
+ }
+ ungetc (c, input);
+ switch (yylex ())
+ {
+ case IDENTIFIER:
+ case TYPENAME:
+ case STRING:
+ case CONSTANT:
+ handle_pragma_token (token_buffer, yylval.ttype);
+ break;
+ default:
+ handle_pragma_token (token_buffer, 0);
+ }
+ if (nextchar >= 0)
+ c = nextchar, nextchar = -1;
+ else
+ c = getc (input);
}
- return -1;
}
#endif /* HANDLE_SYSV_PRAGMA */