mirror of
https://github.com/adamdunkels/ubasic.git
synced 2026-11-21 20:19:45 +00:00
Implemented comments with REM.
This commit is contained in:
parent
ea7a52e61f
commit
9c45ed4588
3 changed files with 19 additions and 4 deletions
13
tokenizer.c
13
tokenizer.c
|
|
@ -65,6 +65,7 @@ static const struct keyword_token keywords[] = {
|
|||
{"gosub", TOKENIZER_GOSUB},
|
||||
{"return", TOKENIZER_RETURN},
|
||||
{"call", TOKENIZER_CALL},
|
||||
{"rem", TOKENIZER_REM},
|
||||
{"end", TOKENIZER_END},
|
||||
{NULL, TOKENIZER_ERROR}
|
||||
};
|
||||
|
|
@ -188,10 +189,22 @@ tokenizer_next(void)
|
|||
|
||||
DEBUG_PRINTF("tokenizer_next: %p\n", nextptr);
|
||||
ptr = nextptr;
|
||||
|
||||
while(*ptr == ' ') {
|
||||
++ptr;
|
||||
}
|
||||
current_token = get_next_token();
|
||||
|
||||
if (current_token == TOKENIZER_REM) {
|
||||
while(!(*nextptr == '\n' || tokenizer_finished())) {
|
||||
++nextptr;
|
||||
}
|
||||
if (*nextptr == '\n') {
|
||||
++nextptr;
|
||||
}
|
||||
tokenizer_next();
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("tokenizer_next: '%s' %d\n", ptr, current_token);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue