From 5426d9e2a6b820e34809d639838b26643df9ab17 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 8 Feb 2022 00:29:10 +0800 Subject: fix errors There are multiple subtle errors in the previous version, both in the codes and in the description of the BNF format. This version should fix some problems now. This version can successfully parse the grammar of its own grammar format, which is quite nice. See test/check_reader.c for parsing this format. --- src/crf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/crf.c') diff --git a/src/crf.c b/src/crf.c index 1c9fea9..5dba8bf 100644 --- a/src/crf.c +++ b/src/crf.c @@ -95,8 +95,10 @@ crf_add_edge(crf *crfp, pair2 source, pair4 label) label.u }; - /* fleprintf("adding (%ld, %ld, %ld, %ld, %ld, %ld)\n", - * p6.x, p6.y, p6.z, p6.u, p6.v, p6.w); */ +#ifdef DEBUG + fleprintf("adding (%ld, %ld, %ld, %ld, %ld, %ld)\n", + p6.x, p6.y, p6.z, p6.u, p6.v, p6.w); +#endif NUM *find_result = luple6_find(crfp->lup, p6); @@ -118,7 +120,9 @@ crf_add_edge(crf *crfp, pair2 source, pair4 label) void destroy_crf(crf *crfp) { + /* fleprintf0("hi\n"); */ destroy_luple6(crfp->lup); + /* fleprintf0("hi\n"); */ free(crfp); } -- cgit v1.2.3-18-g5258