From 3b15ac23fad859b1ad25a57c006095b4911742e6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 21 Oct 2023 11:13:35 +0100 Subject: Reorder functions --- .../java/org/shedlang/compiler/ShedCompiler.java | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/main/java/org/shedlang/compiler/ShedCompiler.java') 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 collectSourceFilePaths(Path sourceRoot) throws IOException { + var paths = new ArrayList(); + Files.walkFileTree(sourceRoot, new SimpleFileVisitor() { + @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 parseSource( Path sourceRoot, List sourceFilePaths @@ -92,30 +118,4 @@ public class ShedCompiler { return untypedNamespaceNodes; } - - private List collectSourceFilePaths(Path sourceRoot) throws IOException { - var paths = new ArrayList(); - Files.walkFileTree(sourceRoot, new SimpleFileVisitor() { - @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; - } } -- cgit v1.2.3