mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-10 23:54:33 +00:00
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:
parent
d751608ca9
commit
c8aecd86d9
@ -126,6 +126,10 @@ static int find_token(void) {
|
|||||||
strlen(applesoft_tokens[i]))) {
|
strlen(applesoft_tokens[i]))) {
|
||||||
|
|
||||||
/* HACK: special case to avoid AT/ATN problem */
|
/* 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;
|
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,
|
||||||
@ -172,6 +176,12 @@ int main(int argc, char **argv) {
|
|||||||
line++;
|
line++;
|
||||||
if (line_ptr==NULL) break;
|
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();
|
linenum=getnum();
|
||||||
if ((linenum>65535) || (linenum<0)) {
|
if ((linenum>65535) || (linenum<0)) {
|
||||||
fprintf(stderr,"Invalid line number %d\n",linenum);
|
fprintf(stderr,"Invalid line number %d\n",linenum);
|
||||||
|
Loading…
Reference in New Issue
Block a user