parser clears lexer when done parsing

This commit is contained in:
herbglitch 2024-10-30 18:41:01 -06:00
parent b10f9b9123
commit 58986021de
4 changed files with 34 additions and 1 deletions

View file

@ -151,6 +151,11 @@ void ARC_Lexer_RegisterTokenRule(ARC_Lexer *lexer, ARC_LexerTokenRule tokenRule)
}
}
void ARC_Lexer_Clear(ARC_Lexer *lexer){
//clear the tokens vector
ARC_Vector_Clear(lexer->tokens);
}
void ARC_Lexer_LexString(ARC_Lexer *lexer, ARC_String **data){
//check if there are any token rules to use
if(ARC_Vector_GetSize(lexer->tokenRules) == 0){