|
5 | 5 | import java.util.ArrayList; |
6 | 6 | import java.util.HashSet; |
7 | 7 | import java.util.List; |
8 | | -import java.util.Map; |
9 | | -import java.util.Map.Entry; |
10 | 8 | import java.util.Set; |
11 | 9 |
|
12 | 10 | import org.spoofax.interpreter.terms.IStrategoTerm; |
13 | 11 | import org.strategoxt.HybridInterpreter; |
14 | 12 | import org.sugarj.common.ATermCommands; |
15 | 13 | import org.sugarj.common.Environment; |
16 | 14 | import org.sugarj.common.FileCommands; |
| 15 | +import org.sugarj.common.Log; |
17 | 16 | import org.sugarj.common.errors.SourceCodeException; |
18 | 17 | import org.sugarj.common.path.Path; |
19 | 18 |
|
@@ -45,26 +44,22 @@ public Set<Path> compile( |
45 | 44 | String source, |
46 | 45 | Path bin, |
47 | 46 | List<Path> path, |
48 | | - Map<Path, String> deferredSourceFilesForSourceFile |
| 47 | + Set<Path> deferredSourceFilesForSourceFile |
49 | 48 | ) throws IOException, ClassNotFoundException, SourceCodeException { |
50 | 49 |
|
51 | 50 |
|
52 | 51 | List<Path> outSourceFiles = new ArrayList<>(); |
53 | 52 | Set<Path> generatedFiles = new HashSet<>(); |
54 | 53 |
|
55 | | - for (Entry<Path, String> deferredSource : deferredSourceFilesForSourceFile.entrySet()) { |
56 | | - String code = deferredSource.getValue(); |
57 | | - |
58 | | - writeToFile(generatedFiles, deferredSource.getKey(), code); |
59 | | - outSourceFiles.add(deferredSource.getKey()); |
60 | | - } |
61 | | - |
| 54 | + outSourceFiles.addAll(deferredSourceFilesForSourceFile); |
| 55 | + |
62 | 56 | if (!source.isEmpty()) { |
63 | 57 | writeToFile(generatedFiles, outFile, source); |
64 | 58 | outSourceFiles.add(outFile); |
65 | 59 | } |
66 | 60 |
|
67 | 61 | if (!outSourceFiles.isEmpty()) { |
| 62 | + Log.log.log("Compile desugared source files " + outSourceFiles, Log.CORE); |
68 | 63 | List<Path> generatedByCompiler = compile(outSourceFiles, bin, path); |
69 | 64 | for (Path p : generatedByCompiler) |
70 | 65 | generatedFiles.add(p); |
|
0 commit comments