don't require line numbers for equates.

This commit is contained in:
Eric Smith 2003-09-12 08:05:09 +00:00
parent 895706eae4
commit 0f0013cdc1
1 changed files with 13 additions and 26 deletions

39
main.c
View File

@ -312,32 +312,19 @@ void get_predef (void)
while (yylex() != '\n')
;
break;
case NUMBER:
switch (yylex()) {
case LI:
case COMMENT:
while (yylex() != '\n')
;
break;
case '\n':
break;
case NAME:
name = token.sval;
if (yylex() != EQ)
crash("Only EQ and LI supported in defines file");
if (yylex() != NUMBER)
crash("EQ operand must be a number");
loc = token.ival;
if (loc > 0x10000 || loc < 0)
crash("Number out of range");
f[loc] |= NAMED;
save_name(loc, name);
while (yylex() != '\n')
;
break;
default:
crash("Invalid line in predef file");
}
case NAME:
name = token.sval;
if (yylex() != EQ)
crash("name can only be used with equate in defines file");
if (yylex() != NUMBER)
crash("EQ operand must be a number");
loc = token.ival;
if (loc > 0x10000 || loc < 0)
crash("Number out of range");
f[loc] |= NAMED;
save_name(loc, name);
while (yylex() != '\n')
;
break;
default:
crash("Invalid line in predef file");