Added pretty printer

This commit is contained in:
Dan Hirsch 2012-05-11 23:35:21 +01:00
parent dc0a7572f7
commit 99804b2abf
3 changed files with 4 additions and 4 deletions

View file

@ -14,7 +14,7 @@ all: libhammer.a test_suite
test_suite: test_suite.o libhammer.a test_suite: test_suite.o libhammer.a
$(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS) $(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS)
libhammer.a: bitreader.o hammer.o libhammer.a: bitreader.o hammer.o pprint.o
bitreader.o: test_suite.h bitreader.o: test_suite.h
hammer.o: hammer.h hammer.o: hammer.h

View file

@ -72,7 +72,7 @@ parse_result_t* do_parse(const parser_t* parser, parse_state_t *state) {
// It doesn't exist... run the // It doesn't exist... run the
parse_result_t *res; parse_result_t *res;
res = parser->fn(parser->env, state); res = parser->fn(parser->env, state);
if (state->input.overrun) if (state->input_stream.overrun)
res = NULL; // overrun is always failure. res = NULL; // overrun is always failure.
// update the cache // update the cache
g_hash_table_replace(state->cache, &key, res); g_hash_table_replace(state->cache, &key, res);

View file

@ -103,7 +103,7 @@ const parser_t* whitespace(const parser_t* p);
const parser_t* left_factor_action(const parser_t* p); const parser_t* left_factor_action(const parser_t* p);
/* Parse a single character *NOT* in charset */ /* Parse a single character *NOT* in charset */
const parser_t* notin(const uint8_t charset, int length); const parser_t* notin(const uint8_t *charset, int length);
/* A no-argument parser that succeeds if there is no more input to parse. */ /* A no-argument parser that succeeds if there is no more input to parse. */
const parser_t* end_p(); const parser_t* end_p();