diff options
Diffstat (limited to 'src/main/java/org/shedlang/compiler/ShedCompiler.java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/ShedCompiler.java | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/main/java/org/shedlang/compiler/ShedCompiler.java b/src/main/java/org/shedlang/compiler/ShedCompiler.java index 02aaf05b..6d917f1d 100644 --- a/src/main/java/org/shedlang/compiler/ShedCompiler.java +++ b/src/main/java/org/shedlang/compiler/ShedCompiler.java @@ -66,6 +66,32 @@ public class ShedCompiler { backend.compile(config, namespaces, typeCheckerContext.toTypeInfos(), config.targetDir().resolve(backend.name())); } + private List<Path> collectSourceFilePaths(Path sourceRoot) throws IOException { + var paths = new ArrayList<Path>(); + Files.walkFileTree(sourceRoot, new SimpleFileVisitor<Path>() { + @Override + public FileVisitResult visitFile( + Path file, + BasicFileAttributes attrs + ) { + if (file.getFileName().toString().endsWith(".shed")) { + paths.add(file); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory( + Path dir, + IOException exc + ) { + return FileVisitResult.CONTINUE; + } + }); + paths.sort(Comparator.naturalOrder()); + return paths; + } + private List<UntypedNamespaceNode> parseSource( Path sourceRoot, List<Path> sourceFilePaths @@ -92,30 +118,4 @@ public class ShedCompiler { return untypedNamespaceNodes; } - - private List<Path> collectSourceFilePaths(Path sourceRoot) throws IOException { - var paths = new ArrayList<Path>(); - Files.walkFileTree(sourceRoot, new SimpleFileVisitor<Path>() { - @Override - public FileVisitResult visitFile( - Path file, - BasicFileAttributes attrs - ) { - if (file.getFileName().toString().endsWith(".shed")) { - paths.add(file); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory( - Path dir, - IOException exc - ) { - return FileVisitResult.CONTINUE; - } - }); - paths.sort(Comparator.naturalOrder()); - return paths; - } } |
