X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=9cbf8b4e0ad8fd5dd613ac6feab5dbb8b0d948b5;hp=08a491678590fb17b6615895055406ffd1a9aeea;hb=HEAD;hpb=7d748dc6e2259984c9093c48d84ae1ed280632ad diff --git a/token.c b/token.c index 08a4916..9cbf8b4 100644 --- a/token.c +++ b/token.c @@ -154,14 +154,6 @@ static char * regname[] = { "a10","b10","x","y","","","ab","ba" // 312,319 }; -WARNING("We should get rid of this table, it's a subset of the table above") -static char * riscregname[] = { - "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", - "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" -}; - // // Initialize tokenizer @@ -517,16 +509,11 @@ arg_num: // This is a hack. It might be better table-driven. d = NULL; - if ((*tk >= REG68_D0) && !rdsp && !rgpu) + if (*tk >= REG68_D0) { d = regname[(int)*tk++ - REG68_D0]; goto strcopy; } - else if ((*tk >= REGRISC_R0) && (*tk <= REGRISC_R31)) - { - d = riscregname[(int)*tk++ - REGRISC_R0]; - goto strcopy; - } else { switch ((int)*tk++) @@ -1270,6 +1257,14 @@ DEBUG { printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); } if (stuffnull) // Arrange for string termination on next pass nullspot = ln; + if (disabled) + { + // When we are in a disabled code block, the only thing that can break out + // of this is an ".endif" keyword, so this is the minimum we have to parse + // in order to discover such a keyword. + goto goteol; + } + continue; }