aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/shedlang/compiler/ShedCompiler.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-10-21 11:13:35 +0100
committerMichael Williamson <mike@zwobble.org>2023-10-21 11:13:35 +0100
commit3b15ac23fad859b1ad25a57c006095b4911742e6 (patch)
treec0c2711562c57a4fab827c1c2afc03c2b2ee0a1c /src/main/java/org/shedlang/compiler/ShedCompiler.java
parentbb7d77def0e86732c440125467b1ffc1648e06bc (diff)
Reorder functions
Diffstat (limited to 'src/main/java/org/shedlang/compiler/ShedCompiler.java')
-rw-r--r--src/main/java/org/shedlang/compiler/ShedCompiler.java52
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;
- }
}