From 1c8cbfd09ff9dd02f6d8d938c45e3f29a35f6f32 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sat, 5 Feb 2022 23:23:03 +0800 Subject: predicates start working now Now we have a working implementation of predicates. It now only remains to write the parser of grammars. Of course we shall generate this parser by this parser generator itself, because why not. ;-P --- src/test/check_cnp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test/check_cnp.c') diff --git a/src/test/check_cnp.c b/src/test/check_cnp.c index a21d74e..f01a68c 100644 --- a/src/test/check_cnp.c +++ b/src/test/check_cnp.c @@ -9,8 +9,9 @@ print_label6(pair6 label) label.x, label.y, label.z, label.u, label.v, label.w); } -#define TIC struct timespec tic, toc; \ - do { clock_gettime(CLOCK_MONOTONIC_RAW, &tic); } while (0) +#define TITO struct timespec tic, toc + +#define TIC do { clock_gettime(CLOCK_MONOTONIC_RAW, &tic); } while (0) #define TOC do { \ clock_gettime(CLOCK_MONOTONIC_RAW, &toc); \ @@ -53,7 +54,7 @@ print_label6(pair6 label) add_to_list(rules, rule); \ } while (0) -#define GRAMMAR 2 +#define GRAMMAR 4 int main(int UNUSED argc, char ** UNUSED argv) @@ -197,6 +198,8 @@ main(int UNUSED argc, char ** UNUSED argv) printf("\nPrinting the input...\n%s\n", get_data((str *) string)); + TITO; + TIC; Environment *env = cnp_parse(g, (str *) string); -- cgit v1.2.3-18-g5258