diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-23 11:50:33 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-23 11:50:33 +0000 |
| commit | a7c33eef7d2598d5636ff5bcde07da4f9c057184 (patch) | |
| tree | 43fd9d2e37c9a4b2e8ebc45ab0ba998aca2b62b1 /src/test/java/org/shedlang/compiler/ast | |
| parent | 924ae7e0ebfd2abaf320a2ad4f3441e5034ffb91 (diff) | |
Parse type level params for sum types
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNodeMatcher.java | 8 |
1 files changed, 8 insertions, 0 deletions
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<Optional<? extends Iterable<? extends UntypedTypeLevelParamNode>>> typeLevelParams + ) { + return with(has("typeLevelParams", x -> x.typeLevelParams(), typeLevelParams)); + } + public UntypedSumTypeDefinitionNodeMatcher withVariants( Matcher<Iterable<? extends UntypedTypeLevelExpressionNode>> variants ) { |
