Added h_parse_result_free().

This commit is contained in:
Meredith L. Patterson 2012-07-27 15:06:40 -07:00
parent 03a1a3c6f0
commit fa093d3b06
2 changed files with 9 additions and 0 deletions

View file

@ -264,6 +264,10 @@ HParseResult* h_parse(const HParser* parser, const uint8_t* input, size_t length
return res;
}
void h_parse_result_free(HParseResult *result) {
h_delete_arena(result->arena);
}
#ifdef INCLUDE_TESTS
#include "test_suite.h"

View file

@ -437,6 +437,11 @@ HParser *h_indirect();
*/
void h_bind_indirect(HParser* indirect, HParser* inner);
/**
* Free the memory allocated to an HParseResult when it is no longer needed.
*/
void h_parse_result_free(HParseResult *result);
// Some debugging aids
/**
* Format token into a compact unambiguous form. Useful for parser test cases.