cc65: remove un-needed logic from octal parsing
We no longer need the extra error handling logic for octal parsing so simplify it as requested by Greg King. Signed-off-by: Alan Cox <etchedpixels@gmail.com>
This commit is contained in:
parent
6ee1fd2a67
commit
e4aee2ba34
1 changed files with 3 additions and 9 deletions
|
@ -337,20 +337,14 @@ static int ParseChar (void)
|
||||||
case '6':
|
case '6':
|
||||||
case '7':
|
case '7':
|
||||||
/* Octal constant */
|
/* Octal constant */
|
||||||
HadError = 0;
|
|
||||||
Count = 1;
|
Count = 1;
|
||||||
C = HexVal (CurC);
|
C = HexVal (CurC);
|
||||||
while (IsODigit (NextC) && Count++ < 3) {
|
while (IsODigit (NextC) && Count++ < 3) {
|
||||||
if ((C << 3) >= 256) {
|
C = (C << 3) | HexVal (NextC);
|
||||||
if (!HadError) {
|
|
||||||
Error ("Octal character constant out of range");
|
|
||||||
HadError = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
C = (C << 3) | HexVal (NextC);
|
|
||||||
}
|
|
||||||
NextChar ();
|
NextChar ();
|
||||||
}
|
}
|
||||||
|
if (C >= 256)
|
||||||
|
Error ("Octal character constant out of range");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Error ("Illegal character constant");
|
Error ("Illegal character constant");
|
||||||
|
|
Loading…
Add table
Reference in a new issue