From 81854107bcf0b4480cfb11e8af7fec6894240c0c Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 1 Aug 2023 11:47:44 +0800 Subject: Fix some bugs Some bugs are fixed: 1. If a non-terminal expansion can be reduced immediately, previously an extra node would be created that had no parents. Now this strange behaviour is corrected. 2. When performing reductions, a leaf non-terminal node would previously be regarded as completed. Now we will first try to complete that node, and then determine if the completion is successful, and finally determine the completedness according to the result. Of course some more tests are still pending, before I can confirm that no more bugs lurk around. --- chain/src/atom/default.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chain/src/atom/default.rs') diff --git a/chain/src/atom/default.rs b/chain/src/atom/default.rs index e156178..6ae924f 100644 --- a/chain/src/atom/default.rs +++ b/chain/src/atom/default.rs @@ -123,7 +123,7 @@ impl DefaultAtom { .accepting_vec .iter() .enumerate() - .filter_map(|(index, pred)| (*pred).then(|| index)) + .filter_map(|(index, pred)| (*pred).then_some(index)) { print!("{nullable}, "); } -- cgit v1.2.3-18-g5258