Added a dedicated function to the tokenizer for getting string literals.
This commit is contained in:
+6
-6
@@ -81,14 +81,14 @@ Token* GetNextToken(char *string) {
|
||||
if (IsOpcode(string_token)) return CreateToken(TK_Opcode, string_token);
|
||||
if (IsRegister(string_token)) return CreateToken(TK_Register, string_token);
|
||||
|
||||
char* next = SplitOnBasicGrammar(NULL);
|
||||
// char* next = SplitOnBasicGrammar(NULL);
|
||||
|
||||
if (next && strcmp(next, ":") == 0) {
|
||||
free(next);
|
||||
return CreateToken(TK_Label, string_token);
|
||||
}
|
||||
// if (next && strcmp(next, ":") == 0) {
|
||||
// free(next);
|
||||
// return CreateToken(TK_Label, string_token);
|
||||
// }
|
||||
|
||||
if (next) free(next);
|
||||
// if (next) free(next);
|
||||
|
||||
return CreateToken(TK_String, string_token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user