aboutsummaryrefslogtreecommitdiff
path: root/bash/step2_eval.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bash/step2_eval.sh')
-rwxr-xr-xbash/step2_eval.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/bash/step2_eval.sh b/bash/step2_eval.sh
index 4d571e4..0f03a79 100755
--- a/bash/step2_eval.sh
+++ b/bash/step2_eval.sh
@@ -3,6 +3,8 @@
INTERACTIVE=${INTERACTIVE-yes}
source $(dirname $0)/reader.sh
+source $(dirname $0)/printer.sh
+source $(dirname $0)/core.sh
# READ: read and parse input
READ () {
@@ -20,17 +22,17 @@ EVAL_AST () {
eval r="\${${env}["${val}"]}"
[ "${r}" ] || _error "'${val}' not found" ;;
list)
- _map_with_type list EVAL "${ast}" "${env}" ;;
+ _map_with_type _list EVAL "${ast}" "${env}" ;;
vector)
- _map_with_type vector EVAL "${ast}" "${env}" ;;
+ _map_with_type _vector EVAL "${ast}" "${env}" ;;
hash_map)
local res="" val="" hm="${ANON["${ast}"]}"
- hash_map; local new_hm="${r}"
+ _hash_map; local new_hm="${r}"
eval local keys="\${!${hm}[@]}"
for key in ${keys}; do
eval val="\${${hm}[\"${key}\"]}"
EVAL "${val}" "${env}"
- assoc! "${new_hm}" "${key}" "${r}"
+ _assoc! "${new_hm}" "${key}" "${r}"
done
r="${new_hm}" ;;
*)