From 8349f31ec76c330c12ebdd7e5fb1d036175030a7 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 28 Jul 2023 19:11:15 +0100 Subject: Store bound variable names in typed block node --- src/test/java/org/shedlang/compiler/ast/typed/Typed.java | 2 +- .../java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/test/java/org/shedlang/compiler/ast') diff --git a/src/test/java/org/shedlang/compiler/ast/typed/Typed.java b/src/test/java/org/shedlang/compiler/ast/typed/Typed.java index 160950b6..7ce49957 100644 --- a/src/test/java/org/shedlang/compiler/ast/typed/Typed.java +++ b/src/test/java/org/shedlang/compiler/ast/typed/Typed.java @@ -14,7 +14,7 @@ public class Typed { } public static TypedBlockNode block(List statements) { - return new TypedBlockNode(statements, Sources.NULL); + return new TypedBlockNode(statements, List.of(), Sources.NULL); } public static TypedBlockReturnNode blockReturn(TypedExpressionNode expression) { diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java index 8ce4b168..3a46fa54 100644 --- a/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java +++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java @@ -35,6 +35,12 @@ public class TypedNodeMatchers { return has("statements", x -> x.statements(), statements); } + public static Matcher isTypedBlockNodeWithBoundVariableNames( + Matcher> boundVariableNames + ) { + return has("boundVariableNames", x -> x.boundVariableNames(), boundVariableNames); + } + public static Matcher isTypedBlockReturnNode( Matcher expression ) { @@ -56,7 +62,7 @@ public class TypedNodeMatchers { } public static Matcher isTypedConditionalBranchNode( - Matcher condition, + Matcher condition, Matcher body ) { return allOf( -- cgit v1.2.3