We declared some functions that were never implemented. Implement them.
This commit is contained in:
parent
a17d189d9d
commit
de6f6115a8
3 changed files with 10 additions and 1 deletions
|
|
@ -62,6 +62,10 @@ HParseResult* h_parse__m(HAllocator* mm__, const HParser* parser, const uint8_t*
|
||||||
return backends[parser->backend]->parse(mm__, parser, &input_stream);
|
return backends[parser->backend]->parse(mm__, parser, &input_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void h_parse_result_free__m(HAllocator *alloc, HParseResult *result) {
|
||||||
|
h_parse_result_free(result);
|
||||||
|
}
|
||||||
|
|
||||||
void h_parse_result_free(HParseResult *result) {
|
void h_parse_result_free(HParseResult *result) {
|
||||||
if(result == NULL) return;
|
if(result == NULL) return;
|
||||||
h_delete_arena(result->arena);
|
h_delete_arena(result->arena);
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ typedef struct HCFChoice_ HCFChoice;
|
||||||
typedef struct HRVMProg_ HRVMProg;
|
typedef struct HRVMProg_ HRVMProg;
|
||||||
typedef struct HParserVtable_ HParserVtable;
|
typedef struct HParserVtable_ HParserVtable;
|
||||||
|
|
||||||
|
// TODO: Make this internal
|
||||||
typedef struct HParser_ {
|
typedef struct HParser_ {
|
||||||
const HParserVtable *vtable;
|
const HParserVtable *vtable;
|
||||||
HParserBackend backend;
|
HParserBackend backend;
|
||||||
|
|
@ -586,7 +587,7 @@ char* h_write_result_unamb(const HParsedToken* tok);
|
||||||
* Format token to the given output stream. Indent starting at
|
* Format token to the given output stream. Indent starting at
|
||||||
* [indent] spaces, with [delta] spaces between levels.
|
* [indent] spaces, with [delta] spaces between levels.
|
||||||
*/
|
*/
|
||||||
HAMMER_FN_DECL(void, h_pprint, FILE* stream, const HParsedToken* tok, int indent, int delta);
|
void h_pprint(FILE* stream, const HParsedToken* tok, int indent, int delta);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build parse tables for the given parser backend. See the
|
* Build parse tables for the given parser backend. See the
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ static const HParserVtable indirect_vt = {
|
||||||
.compile_to_rvm = h_not_regular,
|
.compile_to_rvm = h_not_regular,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void h_bind_indirect__m(HAllocator *mm__, HParser* indirect, const HParser* inner) {
|
||||||
|
h_bind_indirect(indirect, inner);
|
||||||
|
}
|
||||||
|
|
||||||
void h_bind_indirect(HParser* indirect, const HParser* inner) {
|
void h_bind_indirect(HParser* indirect, const HParser* inner) {
|
||||||
assert_message(indirect->vtable == &indirect_vt, "You can only bind an indirect parser");
|
assert_message(indirect->vtable == &indirect_vt, "You can only bind an indirect parser");
|
||||||
indirect->env = (void*)inner;
|
indirect->env = (void*)inner;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue