From 2f9b8599ad3d860099501f5fee3f85866c7863a8 Mon Sep 17 00:00:00 2001 From: Deepanjan Bhattacharyya Date: Tue, 19 Nov 2024 12:02:22 -0800 Subject: [PATCH] Update NodeEvaluator.java --- .../main/java/gyro/core/scope/NodeEvaluator.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/gyro/core/scope/NodeEvaluator.java b/core/src/main/java/gyro/core/scope/NodeEvaluator.java index bf13999cf..38bfaa3db 100644 --- a/core/src/main/java/gyro/core/scope/NodeEvaluator.java +++ b/core/src/main/java/gyro/core/scope/NodeEvaluator.java @@ -339,6 +339,12 @@ public void addTypeNode(Node top, Node node) { addTypeNode(top, item); } } + + if (node instanceof DirectiveNode) { + for (Node item : ((DirectiveNode) node).getBody()) { + addTypeNode(top, item); + } + } } public void evaluateBody(List body, Scope scope) { @@ -771,13 +777,7 @@ private Object resourceResolver(String resourceName, String referenceName, Refer s = s.filter(r -> DiffableInternals.getName(r).startsWith(prefix)); } - List resources = s.collect(Collectors.toList()); - - if (resources.isEmpty()) { - throw new FindDefer(node, referenceName, resourceName); - } - - value = resources; + value = s.collect(Collectors.toList()); } else { Resource resource = root.findResource(referenceName + "::" + resourceName);