From 321f6eeb6599c48718f63e299dcf6ac35d934f85 Mon Sep 17 00:00:00 2001 From: Igor Dejanovic Date: Tue, 23 Jan 2024 11:47:56 +0100 Subject: [PATCH] docs: add a note on Catalan number --- README.md | 3 ++- docs/src/readme_example/src/testglr/mod.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04744b36..3dc48386 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,8 @@ use rustemo::Parser; #[test] fn test_glr() { let forest = CalcParser::new().parse("2 + 3 * 4 + 1").unwrap(); - // We have 5 possible solutions + + // We have 5 possible solutions, see https://en.wikipedia.org/wiki/Catalan_number assert_eq!(forest.solutions(), 5); // Evaluate each tree from the forest diff --git a/docs/src/readme_example/src/testglr/mod.rs b/docs/src/readme_example/src/testglr/mod.rs index 7a3d02f2..491f985f 100644 --- a/docs/src/readme_example/src/testglr/mod.rs +++ b/docs/src/readme_example/src/testglr/mod.rs @@ -7,7 +7,8 @@ use rustemo::Parser; #[test] fn test_glr() { let forest = CalcParser::new().parse("2 + 3 * 4 + 1").unwrap(); - // We have 5 possible solutions + + // We have 5 possible solutions, see https://en.wikipedia.org/wiki/Catalan_number assert_eq!(forest.solutions(), 5); // Evaluate each tree from the forest