From a7c33eef7d2598d5636ff5bcde07da4f9c057184 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 23 Dec 2023 11:50:33 +0000 Subject: Parse type level params for sum types --- .../compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test/java/org/shedlang/compiler/ast') diff --git a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java index aa1ba8d0..42d30cff 100644 --- a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java +++ b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java @@ -6,6 +6,8 @@ import org.shedlang.compiler.types.Visibility; import org.shedlang.compiler.util.P; import org.zwobble.precisely.Matcher; +import java.util.Optional; + import static org.zwobble.precisely.Matchers.equalTo; import static org.zwobble.precisely.Matchers.has; @@ -40,6 +42,12 @@ public class UntypedSumTypeDefinitionNodeMatcher extends MatcherBuilder< return with(has("name", x -> x.name(), equalTo(name))); } + public UntypedSumTypeDefinitionNodeMatcher withTypeLevelParams( + Matcher>> typeLevelParams + ) { + return with(has("typeLevelParams", x -> x.typeLevelParams(), typeLevelParams)); + } + public UntypedSumTypeDefinitionNodeMatcher withVariants( Matcher> variants ) { -- cgit v1.2.3