Skip to content

Commit 26497c4

Browse files
committed
support recursive transformed model imports
1 parent aeb11c8 commit 26497c4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/org/sugarj/AbstractBaseProcessor.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.sugarj.common.Environment;
1414
import org.sugarj.common.FileCommands;
1515
import org.sugarj.common.Log;
16+
import org.sugarj.common.cleardep.CompilationUnit;
1617
import org.sugarj.common.errors.SourceCodeException;
1718
import org.sugarj.common.path.Path;
1819

@@ -43,6 +44,7 @@ public Set<Path> compile(
4344
Path outFile,
4445
String source,
4546
Path bin,
47+
CompilationUnit mod,
4648
List<Path> path,
4749
Set<Path> deferredSourceFilesForSourceFile
4850
) throws IOException, ClassNotFoundException, SourceCodeException {
@@ -54,7 +56,8 @@ public Set<Path> compile(
5456
outSourceFiles.addAll(deferredSourceFilesForSourceFile);
5557

5658
if (!source.isEmpty()) {
57-
writeToFile(generatedFiles, outFile, source);
59+
FileCommands.writeToFile(outFile, source);
60+
mod.addGeneratedFile(outFile);
5861
outSourceFiles.add(outFile);
5962
}
6063

@@ -68,14 +71,9 @@ public Set<Path> compile(
6871
return generatedFiles;
6972
}
7073

71-
private void writeToFile(Set<Path> generatedFiles, Path file, String content) throws IOException {
72-
FileCommands.writeToFile(file, content);
73-
generatedFiles.add(file);
74-
}
75-
7674
public String getImportLocalName(IStrategoTerm decl) { return null; }
7775
public String getModulePath(IStrategoTerm decl) { return null; }
78-
public IStrategoTerm reconstructImport(String modulePath, IStrategoTerm original) { throw new UnsupportedOperationException(); }
76+
public IStrategoTerm reconstructImport(String modulePath) { throw new UnsupportedOperationException(); }
7977
public IStrategoTerm getImportForExport(IStrategoTerm export) { throw new UnsupportedOperationException(); }
8078

8179
/**

0 commit comments

Comments
 (0)