summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
index 353fae1..aa2f09d 100644
--- a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
+++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
@@ -121,6 +121,11 @@ public class JavaPreciselyMatchersGenerator implements Generator {
))
))
),
+ new JavaFieldDeclaration(
+ JavaVisibility.PRIVATE,
+ JavaTypeRef.list(matcherRef(JavaTypeArg.superType(javaStructTypeRef))),
+ "submatchers"
+ ),
new JavaConstructorDeclaration(
matcherTypeName,
JavaVisibility.PRIVATE,
@@ -130,7 +135,14 @@ public class JavaPreciselyMatchersGenerator implements Generator {
"submatchers"
)
),
- new JavaBlock(List.of())
+ new JavaBlock(List.of(
+ new JavaExpressionStatement(
+ new JavaAssignment(
+ new JavaFieldAccess(new JavaRef("this"), "submatchers"),
+ new JavaRef("submatchers")
+ )
+ )
+ ))
),
new JavaMethodDeclaration(
"match",