improve repl
This commit is contained in:
parent
c3fffb1e75
commit
c45c538952
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue