From 34357640c0676f33ad13aac1fe28effc6f6e47c7 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 20 Jul 2025 01:32:24 +0300 Subject: start of grammar parsing --- parts/table.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'parts/table.h') diff --git a/parts/table.h b/parts/table.h index efd19bb..c60ad4f 100644 --- a/parts/table.h +++ b/parts/table.h @@ -2,7 +2,7 @@ #define TABLE_H #include // size_t -#include "util/util.h" +#include "util/util.h" // X_TO_... #define ACTION_TYPE(X) \ X(ACTION_NOT_SET) \ @@ -28,7 +28,7 @@ extern void (*table_free)(); void table_print(); void table_print_cstyle(); -int table_insert(size_t state, symbol sym, struct action a); // should it be here?? +int table_insert(size_t state, symbol sym, struct action a); // should this be here?? #include "symbol.h" @@ -103,7 +103,7 @@ int table_insert(size_t state, symbol sym, struct action a) if(prec_num(tbl_a) > prec_num(new_a)) set_tbl_a = 0; else if(prec_num(tbl_a) < prec_num(new_a)) set_tbl_a = 1; else { report = 1; - if(new_a->arg > tbl_a->arg) set_tbl_a = 1; + if(new_a->arg < tbl_a->arg) set_tbl_a = 1; } } else if(shift_reduce) { int favor_shift = 0; -- cgit v1.2.3