tokenize_asoft: ignore ' and \n

This allows including comments in the pre-tokenized code that are left
out in the final version.
This commit is contained in:
Vince Weaver 2016-05-31 12:14:36 -04:00
parent d751608ca9
commit c8aecd86d9

View File

@ -126,6 +126,10 @@ static int find_token(void) {
strlen(applesoft_tokens[i]))) {
/* HACK: special case to avoid AT/ATN problem */
/* Update, apparently actual applesoft uses */
/* a similar hack. Also the 'A TO' */
/* case which we don't handle because */
/* we like sane whitespace. */
if ((i==69) && (line_ptr[2]=='N')) continue;
// fprintf(stderr,
// "Found token %x (%s) %d\n",0x80+i,
@ -172,6 +176,12 @@ int main(int argc, char **argv) {
line++;
if (line_ptr==NULL) break;
/* VMW extension: use leading ' as a comment char */
if (line_ptr[0]=='\'') continue;
/* skip empty lines */
if (line_ptr[0]=='\n') continue;
linenum=getnum();
if ((linenum>65535) || (linenum<0)) {
fprintf(stderr,"Invalid line number %d\n",linenum);