Code cleanup.
This commit is contained in:
+3
-5
@@ -8,6 +8,7 @@
|
||||
#include "../includes/scanner.h"
|
||||
#include "../includes/parser.h"
|
||||
|
||||
const char* MagicStartName = "__start";
|
||||
List* LIST;
|
||||
SymbolTable* Symbols;
|
||||
|
||||
@@ -30,9 +31,7 @@ int main(int argc, char* args[]) {
|
||||
|
||||
LIST = GenerateTokenList(source_code);
|
||||
|
||||
IRState* state = ParseTokens(LIST);
|
||||
|
||||
Symbols = state->SymbolsTable;
|
||||
Symbols = ParseTokens(LIST);
|
||||
|
||||
free(source_code);
|
||||
|
||||
@@ -125,8 +124,7 @@ unsigned short GetValueFromToken(Token* token) {
|
||||
Symbol* symbol;
|
||||
|
||||
if (TryGetSymbol(token->Lemexe, Symbols, &symbol)) {
|
||||
printf("Returning %d for address of %s.\n", symbol->Address, symbol->Name);
|
||||
return 0xABCD;//symbol->Address;
|
||||
return symbol->Address;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Failed to find symbol %s while assembling.\n", token->Lemexe);
|
||||
|
||||
Reference in New Issue
Block a user