From 96b2a596c11c85d545892bf0845d4dafe1312a29 Mon Sep 17 00:00:00 2001 From: Kia <kia@special-circumstanc.es> Date: Tue, 28 Sep 2021 21:54:46 -0500 Subject: [PATCH] we wanna test the range without an endianness combinator at all --- gen_intrange.c | 4 +++- span.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gen_intrange.c b/gen_intrange.c index 458df2f..456ef5c 100644 --- a/gen_intrange.c +++ b/gen_intrange.c @@ -75,7 +75,9 @@ void HCFS_ADD_CHAR(uint8_t chr) { // and we can just store it in an array or something (and expand the array if we need it) // so we don't need tree-writing code, but we *do* need a way to traverse the output generated by -// gen_int_range -- which is tree-shaped +// gen_int_range -- which *is* tree-shaped + + void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_byte_index) { uint8_t current_byte_index = starting_byte_index; diff --git a/span.c b/span.c index 53f5ecb..1466e4f 100755 --- a/span.c +++ b/span.c @@ -22,6 +22,12 @@ HParser *int16_big(int16_t left, int16_t right) { } +HParser *int16_un_endianned(int16_t left, int16_t right) { + H_RULE(bigint16, h_int16()); + H_RULE(int16range, h_int_range(bigint16, left, right)); + return h_sequence(int16range,h_end_p(),NULL); +} + -- GitLab