Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Java - Styve - Teachers Choice Interpreted Language
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leo
Java - Styve - Teachers Choice Interpreted Language
Commits
6555c817
Commit
6555c817
authored
10 months ago
by
Leo
Committed by
Leo
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: touchup one the main entrypoint
parent
dbc23eb8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.idea/runConfigurations/Main.xml
+1
-1
1 addition, 1 deletion
.idea/runConfigurations/Main.xml
src/Main.java
+5
-5
5 additions, 5 deletions
src/Main.java
with
6 additions
and
6 deletions
.idea/runConfigurations/Main.xml
+
1
−
1
View file @
6555c817
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
src/Main.java
+
5
−
5
View file @
6555c817
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment