improve repl

This commit is contained in:
Daniella 2024-10-22 13:00:35 +02:00
parent c3fffb1e75
commit c45c538952
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -1,6 +1,4 @@
func !!-cat { | }
func main { mega | with args ;
"Welcome to the SPL REPL!" println
"Enter any code after the cursor to execute it.\n" println
@ -12,13 +10,14 @@ func main { mega | with args ;
while { line is-complete not } {
def s
line " > " print readln =s
s "!!-cat" eq dup if { line println }
not if { s "\n" concat concat =line }
s "\n" concat concat =line
}
line _barray =line
line:sub<0 line:len 1 -> _str =line
"!!-end" line:contains if {
2 stop
}
"!!-cat" line:contains if {
"\n" line:contains if {
"" println
line print
"." println