Skip to content

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SingularityT3 committed Apr 13, 2022
1 parent 257aae6 commit 663e5b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ bool REPLMode = true;
int main(int argc, char **argv) {
auto fn = startREPL;

if (argc > 1) {
if (argc == 2) {
psfilename = argv[1];
REPLMode = false;
fn = runFile;
} else if (argc > 2) {
std::cerr << "Too many arguements!\nUsage:\n" << argv[0] << " <filename>" << std::endl;
return EXIT_FAILURE;
}

srand((unsigned int) time(NULL));
Expand Down
2 changes: 1 addition & 1 deletion src/repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static const char *multilineKeywords[] = {
};

bool startREPL() {
std::cout << "PseudoEngine(v2) Experimental REPL\nEnter 'EXIT' to quit\n";
std::cout << "PseudoEngine2 v0.1 REPL\nEnter 'EXIT' to quit\n";

Lexer lexer;
Parser parser;
Expand Down
2 changes: 1 addition & 1 deletion src/runFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bool runFile() {
std::ifstream file(psfilename);

if (!file.is_open()) {
std::cerr << "File not found!" << std::endl;
std::cerr << "Error: File '" << psfilename << "' not found!" << std::endl;
return false;
}

Expand Down

0 comments on commit 663e5b0

Please sign in to comment.