Generate match {} statements by merging adjacent MatchVariant trie edges.

This commit is contained in:
Chris Fallin
2021-09-05 17:21:15 -07:00
parent ed4c857082
commit 3ccbaf0f69
3 changed files with 191 additions and 52 deletions

View File

@@ -2,7 +2,8 @@
(type A (enum
(A1 (x B) (y B))))
(type B (enum
(B1 (x u32))))
(B1 (x u32))
(B2 (x u32))))
(decl A2B (A) B)
@@ -14,6 +15,10 @@
(A2B (A.A1 (B.B1 x) _))
(B.B1 x))
(rule 0
(A2B (A.A1 (B.B2 x) _))
(B.B1 x))
(rule -1
(A2B (A.A1 _ _))
(B.B1 42))