Skip to content

Commit

Permalink
Fix an example
Browse files Browse the repository at this point in the history
  • Loading branch information
mwillsey committed Jun 15, 2021
1 parent 1750e3b commit 7f34597
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tutorials/_02_getting_started.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ let a = egraph.add(SymbolLang::leaf("a"));
let b = egraph.add(SymbolLang::leaf("b"));
let foo = egraph.add(SymbolLang::new("foo", vec![a, b]));
// rebuild the e-graph since we modified it
egraph.rebuild();
// we can make Patterns by parsing, similar to RecExprs
// names preceded by ? are parsed as Pattern variables and will match anything
let pat: Pattern<SymbolLang> = "(foo ?x ?x)".parse().unwrap();
Expand Down

0 comments on commit 7f34597

Please sign in to comment.