Skip to content

Commit

Permalink
docs: add a note on Catalan number
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Jan 23, 2024
1 parent b867181 commit 321f6ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/src/readme_example/src/testglr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 321f6ee

Please sign in to comment.