Skip to content

Commit

Permalink
Added test and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Jun 30, 2024
1 parent b150bb3 commit b4d2489
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/lflang/generator/GeneratorUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.LinkedHashSet;
import java.util.Set;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
Expand Down Expand Up @@ -80,7 +79,7 @@ public static <T> Iterable<T> findAll(Resource resource, Class<T> nodeType) {
}

/**
* Return the resources that provide the given reactors.
* Return the resources that provide the given reactors and their ancestors.
*
* @param reactors The reactors for which to find containing resources.
* @return the resources that provide the given reactors.
Expand All @@ -96,7 +95,8 @@ public static Set<Resource> getResources(Iterable<Reactor> reactors) {
return visited;
}

public static void addInheritedResources(Reactor reactor, Set<Resource> resources) {
/** Collect all resources associated with reactor through class inheritance. */
private static void addInheritedResources(Reactor reactor, Set<Resource> resources) {
resources.add(reactor.eResource());
for (var s : reactor.getSuperClasses()) {
if (!resources.contains(s)) {
Expand Down
10 changes: 7 additions & 3 deletions test/C/src/target/ImportedCMakeInclude.lf
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
target C {
timeout: 1ms
timeout: 1 ms
}

import Foo from "./CMakeInclude.lf"
reactor Bar extends Foo { }

reactor Bar extends Foo {
}

main reactor {
r = new Foo()
}
}

0 comments on commit b4d2489

Please sign in to comment.