parserlang now working
This commit is contained in:
parent
f0a20f2374
commit
5a5eaabc14
5 changed files with 214 additions and 166 deletions
|
|
@ -300,21 +300,23 @@ void ARC_Parser_Parse(ARC_Parser *parser, ARC_String **data){
|
|||
ARC_Bool parsed = ARC_Parser_ParseTag(parser, tagToken, &lexerIndex);
|
||||
ARC_Bool allTokensParsed = lexerIndex == ARC_Lexer_GetTokensSize(parser->lexer);
|
||||
|
||||
//error if anything went wrong
|
||||
if(parsed == ARC_False || allTokensParsed == ARC_False || arc_errno){
|
||||
ARC_Lexer_Clear(parser->lexer);
|
||||
|
||||
arc_errno = ARC_ERRNO_DATA;
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_Parser_Parse(parser, data), could not parse the given data at lexer index: %u", lexerIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
//create the data if the creation callback exists
|
||||
if(parser->createDataFn != NULL){
|
||||
(*(parser->createDataFn))(&(parser->data), tagToken, parser->userData);
|
||||
}
|
||||
|
||||
//cleanup
|
||||
ARC_ParserTagToken_Destroy(tagToken);
|
||||
ARC_Lexer_Clear(parser->lexer);
|
||||
|
||||
//error if anything went wrong
|
||||
if(parsed == ARC_False || allTokensParsed == ARC_False || arc_errno){
|
||||
arc_errno = ARC_ERRNO_DATA;
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_Parser_Parse(parser, data), could not parse the given data at lexer index: %u", lexerIndex);
|
||||
return;
|
||||
}
|
||||
ARC_ParserTagToken_Destroy(tagToken);
|
||||
}
|
||||
|
||||
void ARC_Parser_ParseFile(ARC_Parser *parser, ARC_String *path){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue