Skip to content
Snippets Groups Projects
Commit 6555c817 authored by Leo's avatar Leo Committed by Leo
Browse files

chore: touchup one the main entrypoint

parent dbc23eb8
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<configuration default="false" name="Main" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="styve" />
<option name="PROGRAM_PARAMETERS" value="examples/unary.styve -p" />
<option name="PROGRAM_PARAMETERS" value="examples" />
<method v="2">
<option name="Make" enabled="true" />
</method>
......
......@@ -64,11 +64,12 @@ public class Main {
files.add(filePath);
}
if (files.isEmpty()) {
throw new RuntimeException("No files found in directory: " + filename);
throw new RuntimeException("No valid files provided");
}
// Sort the files by name
files.sort(Path::compareTo);
System.out.println(files.size() + " files found in directory: " + filename);
System.out.println(files.size() + " file(s) queued for processing");
System.out.println("Debug mode: " + debug);
for (Path file : files) {
if (!validateFileExtension(file.toString())) {
System.out.println("Invalid file extension: " + file);
......@@ -76,8 +77,7 @@ public class Main {
continue;
}
String code = null;
System.out.println("=".repeat(25));
System.out.println("Debug mode: " + debug);
System.out.println("\n" + "=".repeat(25));
System.out.println("Reading file: " + file);
System.out.println("\tPath: " + file);
boolean fileExists = Files.exists(file);
......@@ -92,7 +92,7 @@ public class Main {
System.exit(1);
}
System.out.println(Colors.GREEN + "\tFile read successfully" + Colors.RESET);
System.out.println("=".repeat(25) + "\n");
System.out.println("=".repeat(25));
parser = new Parser(debug);
Environment rootEnv = Environment.createGlobalScope();
// Parse and evaluate the program
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment