hammer/src/parsers/nothing.c

21 lines
447 B
C
Raw Normal View History

2012-05-26 16:00:43 +02:00
#include "parser_internal.h"
static HParseResult* parse_nothing() {
// not a mistake, this parser always fails
return NULL;
}
static const HParserVtable nothing_vt = {
.parse = parse_nothing,
};
2012-10-10 15:58:03 +02:00
const HParser* h_nothing_p() {
return h_nothing_p__m(&system_allocator);
}
const HParser* h_nothing_p__m(HAllocator* mm__) {
HParser *ret = h_new(HParser, 1);
2012-05-26 16:00:43 +02:00
ret->vtable = &nothing_vt; ret->env = NULL;
return (const HParser*)ret;
}