From 6f52cdc6a2593094652d0ff018b4cde1276a1815 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 14 Jun 2026 10:45:49 +0100 Subject: Add import node --- .../ast/untyped/UntypedImportNodeMatcher.java | 38 ++++++++++++++++++++++ .../ast/untyped/UntypedNamespaceNodeMatcher.java | 4 +++ 2 files changed, 42 insertions(+) create mode 100644 src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedImportNodeMatcher.java (limited to 'src/test/java/org') diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedImportNodeMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedImportNodeMatcher.java new file mode 100644 index 0000000..9c8c183 --- /dev/null +++ b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedImportNodeMatcher.java @@ -0,0 +1,38 @@ +// Generated by hobgoblin. + +package org.zwobble.hobgoblin.compiler.ast.untyped; + +public class UntypedImportNodeMatcher implements org.zwobble.precisely.Matcher { + public static org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher isUntypedImportNode() { + return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher(java.util.List.of()); + } + + private final java.util.List> submatchers; + + private UntypedImportNodeMatcher(java.util.List> submatchers) { + this.submatchers = submatchers; + } + + public org.zwobble.precisely.MatchResult match(java.lang.Object actual) { + return this.toMatcher().match(actual); + } + + public org.zwobble.precisely.TextTree describe() { + return this.toMatcher().describe(); + } + + private org.zwobble.precisely.Matcher toMatcher() { + return org.zwobble.precisely.Matchers.instanceOf(org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNode.class, this.submatchers); + } + + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher withImportedNames(org.zwobble.precisely.Matcher> importedNames) { + return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher(java.util.stream.Stream.concat(this.submatchers.stream(), java.util.stream.Stream.of(org.zwobble.precisely.Matchers.has("importedNames", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNode::importedNames, importedNames))).toList()); + } + + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher withNamespaceName(org.zwobble.precisely.Matcher namespaceName) { + return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher(java.util.stream.Stream.concat(this.submatchers.stream(), java.util.stream.Stream.of(org.zwobble.precisely.Matchers.has("namespaceName", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNode::namespaceName, namespaceName))).toList()); + } + + // Custom area start: org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher body + // Custom area end: org.zwobble.hobgoblin.compiler.ast.untyped.UntypedImportNodeMatcher body +} diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNamespaceNodeMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNamespaceNodeMatcher.java index 96a3b96..f511b45 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNamespaceNodeMatcher.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNamespaceNodeMatcher.java @@ -29,6 +29,10 @@ public class UntypedNamespaceNodeMatcher implements org.zwobble.precisely.Matche return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNodeMatcher(java.util.stream.Stream.concat(this.submatchers.stream(), java.util.stream.Stream.of(org.zwobble.precisely.Matchers.has("namespaceName", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNode::namespaceName, namespaceName))).toList()); } + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNodeMatcher withImports(org.zwobble.precisely.Matcher> imports) { + return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNodeMatcher(java.util.stream.Stream.concat(this.submatchers.stream(), java.util.stream.Stream.of(org.zwobble.precisely.Matchers.has("imports", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNode::imports, imports))).toList()); + } + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNodeMatcher withBody(org.zwobble.precisely.Matcher> body) { return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNodeMatcher(java.util.stream.Stream.concat(this.submatchers.stream(), java.util.stream.Stream.of(org.zwobble.precisely.Matchers.has("body", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNamespaceNode::body, body))).toList()); } -- cgit v1.2.3