Add support for the nil type and empty arrays
This commit is contained in:
parent
2b09cc2e58
commit
4db7643704
13
lib/serv.sh
13
lib/serv.sh
|
@ -42,12 +42,25 @@ parse_err() {
|
|||
}
|
||||
|
||||
parse_bulk() {
|
||||
if [[ $1 = \$-1 ]]; then
|
||||
(( lines_left -= 1 ))
|
||||
printf '(nil)\n'
|
||||
else
|
||||
bulk=1
|
||||
fi
|
||||
}
|
||||
|
||||
parse_arr() {
|
||||
if [[ $1 = \*-1 ]]; then
|
||||
(( lines_left -= 1 ))
|
||||
printf '(nil)\n'
|
||||
elif [[ $1 = \*0 ]]; then
|
||||
(( lines_left -= 1 ))
|
||||
printf '(empty array)\n'
|
||||
else
|
||||
lines_left=${1:1}
|
||||
arr=1
|
||||
fi
|
||||
}
|
||||
|
||||
parse_other() {
|
||||
|
|
Loading…
Reference in New Issue