summaryrefslogtreecommitdiff
path: root/src/test/check_cnp.c
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-02-05 23:23:03 +0800
committerJSDurand <mmemmew@gmail.com>2022-02-05 23:23:03 +0800
commit1c8cbfd09ff9dd02f6d8d938c45e3f29a35f6f32 (patch)
treee3d6bb3b5246bcfa38662615ad59663d5b0377d1 /src/test/check_cnp.c
parent510b10b96b546fcc6c6b6be85050305ddd192a41 (diff)
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
Diffstat (limited to 'src/test/check_cnp.c')
-rw-r--r--src/test/check_cnp.c9
1 files changed, 6 insertions, 3 deletions
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);