From 24b348cffdc0caef9c4f71e4743e4ddfe260e233 Mon Sep 17 00:00:00 2001
From: Rob Bocchino
Date: Tue, 18 Nov 2025 16:51:31 -0800
Subject: [PATCH] Revise ComputeDependencies
Revise User's Guide
---
.../analysis/ComputeDependencies/AddDependencies.scala | 8 ++++++--
docs/fpp-spec.html | 2 +-
docs/fpp-users-guide.html | 10 +++++++---
docs/users-guide/Specifying-Models-as-Files.adoc | 8 ++++++--
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/compiler/lib/src/main/scala/analysis/ComputeDependencies/AddDependencies.scala b/compiler/lib/src/main/scala/analysis/ComputeDependencies/AddDependencies.scala
index a257a38c6..121a5330c 100644
--- a/compiler/lib/src/main/scala/analysis/ComputeDependencies/AddDependencies.scala
+++ b/compiler/lib/src/main/scala/analysis/ComputeDependencies/AddDependencies.scala
@@ -13,10 +13,14 @@ object AddDependencies extends BasicUseAnalyzer {
node: Ast.Annotated[AstNode[Ast.DefTopology]]
) = {
for {
+ // Add dependencies based on explicit and implicit uses in the topology
a <- super.defTopologyAnnotatedNode(a, node)
+ // Add dependencies on all dictionary definitions
+ // Every topology has all dictionary definitions in its dictionary
a <- {
- val specLocs = a.locationSpecifierMap.values.map(_.data).filter(_.isDictionaryDef)
- Result.foldLeft (specLocs.toList) (a) {
+ val dictionarySpecLocs =
+ a.locationSpecifierMap.values.map(_.data).filter(_.isDictionaryDef)
+ Result.foldLeft (dictionarySpecLocs.toList) (a) {
case (a, s) => addDependencies (a) (s)
}
}
diff --git a/docs/fpp-spec.html b/docs/fpp-spec.html
index fbcf11e19..61ebcb122 100644
--- a/docs/fpp-spec.html
+++ b/docs/fpp-spec.html
@@ -12037,7 +12037,7 @@ equivalent.
diff --git a/docs/fpp-users-guide.html b/docs/fpp-users-guide.html
index 72c5abe22..72a7f7fb9 100644
--- a/docs/fpp-users-guide.html
+++ b/docs/fpp-users-guide.html
@@ -12748,8 +12748,12 @@ locate dictionary constant b at "b.fpp"
The dictionary keyword tells the analyzer that the definition is a dictionary
-definition and so should be included in the dependency files of the model,
-regardless of whether the definition is used in the model.
+definition.
+This fact is important when the model includes a topology definition.
+In this case, the analyzer includes all dictionary definitions as
+dependencies of the model.
+That way the definitions are available
+when generating the dictionary for the topology.
If a definition is a dictionary definition and the corresponding location
@@ -16220,7 +16224,7 @@ serialized according to its
diff --git a/docs/users-guide/Specifying-Models-as-Files.adoc b/docs/users-guide/Specifying-Models-as-Files.adoc
index 2a126d7ba..1bbdef2ae 100644
--- a/docs/users-guide/Specifying-Models-as-Files.adoc
+++ b/docs/users-guide/Specifying-Models-as-Files.adoc
@@ -464,8 +464,12 @@ locate dictionary constant b at "b.fpp"
----
The `dictionary` keyword tells the analyzer that the definition is a dictionary
-definition and so should be included in the dependency files of the model,
-regardless of whether the definition is used in the model.
+definition.
+This fact is important when the model includes a topology definition.
+In this case, the analyzer includes all dictionary definitions as
+dependencies of the model.
+That way the definitions are available
+when generating the dictionary for the topology.
If a definition is a dictionary definition and the corresponding location
specifier does not specify `dictionary` (or vice versa), then the analyzer