Skip to content

Commit b6a92cd

Browse files
committed
Include I/O variables when keeping track of types for validation
1 parent b1d674f commit b6a92cd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/kotlin/me/nallen/modularcodegeneration/hybridautomata/HybridNetwork.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,13 @@ class HybridNetwork(override var name: String = "Network") : HybridItem(){
270270

271271
val writeableVars = ArrayList<String>()
272272
val readableVars = ArrayList<String>()
273+
val variableTypes = HashMap<String, VariableType>()
273274

274275
// We need to keep track of what variables we can write to and read from in this network
275276
for(variable in this.variables) {
277+
// Keep track of variable types
278+
variableTypes[variable.name] = variable.type
279+
276280
// Many things can be read from
277281
if(variable.locality == Locality.EXTERNAL_INPUT || variable.locality == Locality.INTERNAL || variable.locality == Locality.PARAMETER) {
278282
readableVars.add(variable.name)
@@ -286,8 +290,6 @@ class HybridNetwork(override var name: String = "Network") : HybridItem(){
286290
// We want to keep track of each definition we've validated so that we don't run it multiple times
287291
val validated = ArrayList<UUID>()
288292

289-
val variableTypes = HashMap<String, VariableType>()
290-
291293
// Firstly, let's iterate over every sub-instance
292294
for((name, instance) in this.instances) {
293295
// Fetch the definition

0 commit comments

Comments
 (0)