repo.or.cz
/
notion
/
jeffpc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No longer trap fatal signals
[notion/jeffpc.git]
/
utils
/
repl.pl
blob
890959865e12c3756509910ea58fc0913868d87e
1
#!/usr/bin/perl
2
3
use
strict
;
4
5
print
"lua> "
;
6
7
while
(
my
$command
= <
STDIN
>) {
8
if
(
$command
=~
/^\s*([a-zA-Z_0-9]+)\s*=(.*)/
) {
9
$command
=
"
$command
; return
$1
;"
;
10
}
elsif
(
$command
=~
/return/
) {
11
$command
=
$command
;
12
}
else
{
13
$command
=
"return
$command
"
;
14
}
15
print
`notionflux -e "
$command
"`
;
16
print
"lua> "
;
17
}