tokenize_asoft: fix so it handles AT/ATN case properly

a bit of a hack though
This commit is contained in:
Vince Weaver 2016-05-25 15:20:48 -04:00
parent 7ec38fd060
commit e5f2c1de1a

View File

@ -89,6 +89,8 @@ static int getnum(void) {
static int in_quotes=0,in_rem=0; static int in_quotes=0,in_rem=0;
/* note: try to find longest possible token */
/* otherwise ATN is turned into AT N */
static int find_token(void) { static int find_token(void) {
int ch,i; int ch,i;
@ -122,6 +124,9 @@ static int find_token(void) {
for(i=0;i<NUM_TOKENS;i++) { for(i=0;i<NUM_TOKENS;i++) {
if (!strncmp(line_ptr,applesoft_tokens[i], if (!strncmp(line_ptr,applesoft_tokens[i],
strlen(applesoft_tokens[i]))) { strlen(applesoft_tokens[i]))) {
/* HACK: special case to avoid AT/ATN problem */
if ((i==69) && (line_ptr[2]=='N')) continue;
// fprintf(stderr, // fprintf(stderr,
// "Found token %x (%s) %d\n",0x80+i, // "Found token %x (%s) %d\n",0x80+i,
// applesoft_tokens[i],i); // applesoft_tokens[i],i);