File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ static const std::string multilineKeywords[] = {
2020};
2121
2222bool startREPL () {
23- std::cout << " PseudoEngine2 v" << PseudoEngine2_VERSION_MAJOR << ' .' << PseudoEngine2_VERSION_MINOR << ' .' << PseudoEngine2_VERSION_PATCH << " REPL\n Enter 'EXIT' to quit\n " ;
23+ std::cout << " PseudoEngine2 v" << PseudoEngine2_VERSION_MAJOR << ' .' << PseudoEngine2_VERSION_MINOR << ' .' << PseudoEngine2_VERSION_PATCH << " REPL\n Enter '?' for help, ' EXIT' to quit\n " ;
2424
2525 Lexer lexer;
2626 Parser parser;
@@ -32,8 +32,12 @@ bool startREPL() {
3232
3333 size_t size = code.size ();
3434 if (size == 0 ) continue ;
35- if (code == " EXIT" ) break ;
36- if (code.starts_with (" RUNFILE" )) {
35+ if (code == " ?" ) {
36+ std::cout << " Visit https://github.com/SingularityT3/PseudoEngine2 for syntax, examples and more info\n Use `RUNFILE <filename>` to run programs stored in files" << std::endl;
37+ continue ;
38+ } else if (code == " EXIT" ) {
39+ break ;
40+ } else if (code.starts_with (" RUNFILE" )) {
3741 if (size < 9 ) {
3842 std::cerr << " Expected filename" << std::endl;
3943 continue ;
@@ -45,10 +49,10 @@ bool startREPL() {
4549 }
4650 REPLMode = false ;
4751
48- std::cout << " Running file " << psfilename << " \n " ;
52+ std::cout << " ==> Running file ' " << psfilename << " ' \n " ;
4953 std::string exit = runFile () ? " successfully" : " with an error" ;
50- std::cout << " \n Program exited " << exit << " \n " ;
51-
54+ std::cout << " \n ==> Program exited " << exit << " \n " ;
55+
5256 psfilename = " <stdin>" ;
5357 REPLMode = true ;
5458 continue ;
You can’t perform that action at this time.
0 commit comments