diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa08d81..b7e5620 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,10 +26,10 @@ These data structures should be as independent as they can be, but there are som ```mermaid graph TB - Toy_Value ---> Toy_Stack - Toy_Value ---> Toy_String - Toy_Value ---> Toy_Table Toy_Bucket ---> Toy_String + Toy_Value ---> Toy_String + Toy_Value ---> Toy_Stack + Toy_Value ---> Toy_Table Toy_Array ``` diff --git a/README.md b/README.md index 6481910..737d90f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,11 @@ This repository holds the reference implementation for Toy version 2.x, written # Syntax ```toy -print 42; //print is a built-in keyword +//print is a built-in keyword, that can handle complex expressions +print 6 * 7; + +//strings can be concatenated with the .. operator +print "Hello" .. "world!"; //more examples to be added as the features are implemented ``` diff --git a/repl/main.c b/repl/main.c index c05aed7..202733c 100644 --- a/repl/main.c +++ b/repl/main.c @@ -186,6 +186,11 @@ int repl(const char* name) { inputBuffer[--length] = '\0'; } + if (length == 0) { + printf("%s> ", name); //shows the terminal prompt + continue; + } + //end if (strlen(inputBuffer) == 4 && (strncmp(inputBuffer, "exit", 4) == 0 || strncmp(inputBuffer, "quit", 4) == 0)) { break;