improve repl

This commit is contained in:
Daniella / Tove 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 ; func main { mega | with args ;
"Welcome to the SPL REPL!" println "Welcome to the SPL REPL!" println
"Enter any code after the cursor to execute it.\n" 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 } { while { line is-complete not } {
def s def s
line " > " print readln =s line " > " print readln =s
s "!!-cat" eq dup if { line println } s "\n" concat concat =line
not if { s "\n" concat concat =line }
} }
line _barray =line
line:sub<0 line:len 1 -> _str =line
"!!-end" line:contains if { "!!-end" line:contains if {
2 stop 2 stop
} }
"!!-cat" line:contains if { "\n" line:contains if {
"" println "" println
line print line print
"." println "." println