modified the treatment of op=, ++ and -- operators

This commit is contained in:
erikb 1986-09-29 13:16:11 +00:00
parent 66c247ba9c
commit 42112db262

View file

@ -105,13 +105,8 @@ GetToken(ptok)
again: /* rescan the input after an error or replacement */ again: /* rescan the input after an error or replacement */
LoadChar(ch); LoadChar(ch);
go_on: /* rescan, the following character has been read */ go_on: /* rescan, the following character has been read */
/* The following test is made to strip off the nonascii's */ if ((ch & 0200) && ch != EOI) /* stop on non-ascii character */
if ((ch & 0200) && ch != EOI) {
/* this is the only user-error which causes the
process to stop abruptly.
*/
fatal("non-ascii '\\%03o' read", ch & 0377); fatal("non-ascii '\\%03o' read", ch & 0377);
}
switch (class(ch)) { /* detect character class */ switch (class(ch)) { /* detect character class */
case STNL: /* newline, vertical space or formfeed */ case STNL: /* newline, vertical space or formfeed */
LineNumber++; /* also at vs and ff */ LineNumber++; /* also at vs and ff */
@ -150,8 +145,7 @@ go_on: /* rescan, the following character has been read */
case STSIMP: /* a simple character, no part of compound token*/ case STSIMP: /* a simple character, no part of compound token*/
if (ch == '/') { /* probably the start of comment */ if (ch == '/') { /* probably the start of comment */
LoadChar(ch); LoadChar(ch);
if (ch == '*') { if (ch == '*') { /* start of comment */
/* start of comment */
skipcomment(); skipcomment();
goto again; goto again;
} }
@ -189,12 +183,8 @@ go_on: /* rescan, the following character has been read */
case '<': case '<':
if (AccFileSpecifier) { if (AccFileSpecifier) {
PushBack(); /* pushback nch */ PushBack(); /* pushback nch */
ptok->tk_bts = ptok->tk_bts = string_token("file specifier",
string_token( '>', &(ptok->tk_len));
"file specifier",
'>',
&(ptok->tk_len)
);
return ptok->tk_symb = FILESPECIFIER; return ptok->tk_symb = FILESPECIFIER;
} }
if (nch == '<') if (nch == '<')
@ -284,11 +274,10 @@ go_on: /* rescan, the following character has been read */
} }
#endif NOPP #endif NOPP
ptok->tk_symb = ( ptok->tk_symb = (
idef->id_reserved ? idef->id_reserved ? idef->id_reserved
idef->id_reserved : : idef->id_def && idef->id_def->df_sc == TYPEDEF ?
idef->id_def && idef->id_def->df_sc == TYPEDEF ? TYPE_IDENTIFIER
TYPE_IDENTIFIER : : IDENTIFIER
IDENTIFIER
); );
return IDENTIFIER; return IDENTIFIER;
} }
@ -467,8 +456,7 @@ skipcomment()
return; return;
} }
LoadChar(c); LoadChar(c);
} } /* last Character seen was '*' */
/* Last Character seen was '*' */
LoadChar(c); LoadChar(c);
} while (c != '/'); } while (c != '/');
NoUnstack--; NoUnstack--;
@ -557,8 +545,8 @@ val_in_base(ch, base)
register int ch; register int ch;
{ {
return return
is_dig(ch) ? ch - '0' : is_dig(ch) ? ch - '0'
base != 16 ? -1 : : base != 16 ? -1
is_hex(ch) ? (ch - 'a' + 10) & 017 : : is_hex(ch) ? (ch - 'a' + 10) & 017
-1; : -1;
} }