Started rethinking how this machine should behave. Updated and refactoring some things with a few new ideas.
This commit is contained in:
+6
-7
@@ -67,7 +67,7 @@ List* GenerateTokenList(const char* source) {
|
||||
Line++;
|
||||
}
|
||||
break;
|
||||
case '.': //directive like ".org" or ".db"
|
||||
case '.': //directive like ".include" or ".db"
|
||||
token = ParseDirective();
|
||||
if (token) AddListItem(token, tokens);
|
||||
break;
|
||||
@@ -191,17 +191,16 @@ Token* ParseDirective(void) {
|
||||
|
||||
return token;
|
||||
}
|
||||
else if (strcmp(directive, ".org") == 0) {
|
||||
fprintf(stderr, "[Warning] Org is not a supported directive.\n");
|
||||
free(directive);
|
||||
free(token);
|
||||
IgnoreLine();
|
||||
return NULL;
|
||||
else if (strcmp(directive, ".include") == 0) {
|
||||
token->Value.Directive = Include;
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
fprintf(stderr, "[Error] Unknown assembler directive '%s'\n", directive);
|
||||
|
||||
free(directive);
|
||||
free(token);
|
||||
|
||||
IgnoreLine();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user