@@ -6,14 +6,14 @@ module TEST-MATCH-ASSOC
66 syntax UpperName ::= "Data" [token]
77 | "Loc" [token]
88 | "W" [token]
9- | "X" [token]
10- | "Y" [token]
9+ | "X0" [token]
10+ | "Y0" [token]
1111 | "Z" [token]
1212
1313 rule test("match-assoc" , 1 )
1414 => assert ( #error("No valid substitution"), .MatchResults
15- == #matchAssoc( terms: pto( X { Loc }, Y { Data })
16- , pattern: pto( Z { Loc }, W { Data })
15+ == #matchAssoc( terms: pto( X0 { Loc }, Y0 { Data })
16+ , pattern: pto( Z { Loc }, W { Data })
1717 , variables: W { Data }
1818 , subst: .Map
1919 , rest: .Patterns
@@ -22,8 +22,8 @@ module TEST-MATCH-ASSOC
2222 .Declarations
2323 rule test("match-assoc" , 2 )
2424 => assert ( #error("Constructors do not match"), .MatchResults
25- == #matchAssoc( terms: c( X { Loc }, Y { Data })
26- , pattern: d( Z { Loc }, W { Data })
25+ == #matchAssoc( terms: c( X0 { Loc }, Y0 { Data })
26+ , pattern: d( Z { Loc }, W { Data })
2727 , variables: Z { Loc }, W { Data }
2828 , subst: .Map
2929 , rest: .Patterns
@@ -32,7 +32,7 @@ module TEST-MATCH-ASSOC
3232 .Declarations
3333 rule test("match-assoc" , 3 )
3434 => assert ( #error( "Mismatch in length of arguments" ), .MatchResults
35- == #matchAssoc( terms: pto( X { Loc }, Y { Data })
35+ == #matchAssoc( terms: pto( X0 { Loc }, Y0 { Data })
3636 , pattern: .Patterns
3737 , variables: .Patterns
3838 , subst: .Map
@@ -42,8 +42,8 @@ module TEST-MATCH-ASSOC
4242 .Declarations
4343 rule test("match-assoc" , 4 )
4444 => assert ( #error( "Mismatch in length of arguments" ), .MatchResults
45- == #matchAssoc( terms: c(X { Loc }, Y { Data })
46- , pattern: c(X { Loc }, Y { Data }, Y { Data })
45+ == #matchAssoc( terms: c(X0 { Loc }, Y0 { Data })
46+ , pattern: c(X0 { Loc }, Y0 { Data }, Y0 { Data })
4747 , variables: .Patterns
4848 , subst: .Map
4949 , rest: .Patterns
@@ -66,13 +66,13 @@ module TEST-MATCH-ASSOC
6666 .Declarations
6767 // Basic Matching
6868 rule test("match-assoc" , 6 )
69- => assert ( #matchResult( subst: Z { Loc } |-> X { Loc }
70- W { Data } |-> Y { Data }
69+ => assert ( #matchResult( subst: Z { Loc } |-> X0 { Loc }
70+ W { Data } |-> Y0 { Data }
7171 , rest: .Patterns
7272 )
7373 , .MatchResults
74- == #matchAssoc( terms: pto( X { Loc }, Y { Data })
75- , pattern: pto( Z { Loc }, W { Data })
74+ == #matchAssoc( terms: pto( X0 { Loc }, Y0 { Data })
75+ , pattern: pto( Z { Loc }, W { Data })
7676 , variables: Z { Loc }, W { Data }
7777 , subst: .Map
7878 , rest: .Patterns
@@ -81,13 +81,13 @@ module TEST-MATCH-ASSOC
8181 .Declarations
8282 // Match multiple occurances of a variable
8383 rule test("match-assoc" , 7 )
84- => assert ( #matchResult( subst: Z { Loc } |-> X { Loc }
85- W { Data } |-> Y { Data }
84+ => assert ( #matchResult( subst: Z { Loc } |-> X0 { Loc }
85+ W { Data } |-> Y0 { Data }
8686 , rest: .Patterns
8787 )
8888 , .MatchResults
89- == #matchAssoc( terms: c( X { Loc }, Y { Data }), d( X { Loc }, Y { Data })
90- , pattern: c( Z { Loc }, W { Data }), d( Z { Loc }, W { Data })
89+ == #matchAssoc( terms: c( X0 { Loc }, Y0 { Data }), d( X0 { Loc }, Y0 { Data })
90+ , pattern: c( Z { Loc }, W { Data }), d( Z { Loc }, W { Data })
9191 , variables: Z { Loc }, W { Data }
9292 , subst: .Map
9393 , rest: .Patterns
@@ -98,8 +98,8 @@ module TEST-MATCH-ASSOC
9898 rule test("match-assoc" , 8 )
9999 => assert ( #error( "No valid substitution" )
100100 , .MatchResults
101- == #matchAssoc( terms: c( X { Loc }, Y { Data }), c( X { Loc }, Y { Data })
102- , pattern: c( Z { Loc }, W { Data }), c( Y { Loc }, W { Data })
101+ == #matchAssoc( terms: c( X0 { Loc }, Y0 { Data }), c( X0 { Loc }, Y0 { Data })
102+ , pattern: c( Z { Loc }, W { Data }), c( Y0 { Loc }, W { Data })
103103 , variables: Z { Loc }, W { Data }
104104 , subst: .Map
105105 , rest: .Patterns
@@ -109,10 +109,11 @@ module TEST-MATCH-ASSOC
109109
110110 // Match constructor against variable
111111 rule test("match-assoc" , 9 )
112- => assert ( #error("Constructors do not match")
112+ => symbol pto ( Loc, Data ) : Heap
113+ assert ( #error("Constructors do not match")
113114 , .MatchResults
114- == #matchAssoc( terms: X { Loc }, Y { Data }
115- , pattern: c( Z { Loc }, W { Data }), c( Y { Loc }, W { Data })
115+ == #matchAssoc( terms: X0 { Loc }, Y0 { Data }
116+ , pattern: c( Z { Loc }, W { Data }), c( Y0 { Loc }, W { Data })
116117 , variables: Z { Loc }, W { Data }
117118 , subst: .Map
118119 , rest: .Patterns
0 commit comments