4 _TOP_DIR
:= $(dir $(lastword
$(MAKEFILE_LIST
)))
5 include $(_TOP_DIR
)types.mk
6 include $(_TOP_DIR
)reader.mk
7 include $(_TOP_DIR
)printer.mk
12 # READ: read and parse input
14 $(if
$(READLINE_EOF
)$(__ERROR
),,$(call READ_STR
,$(if
$(1),$(1),$(call READLINE
,"user> "))))
17 # EVAL: just return the input
19 $(if
$(READLINE_EOF
)$(__ERROR
),,$(1))
24 $(if
$(__ERROR
),Error
: $(call _pr_str
,$(__ERROR
),yes
),$(if
$(1),$(call _pr_str
,$(1),yes
)))$(if
$(__ERROR
),$(eval __ERROR
:=),)
27 # REPL: read, eval, print, loop
28 REP
= $(call PRINT
,$(strip $(call EVAL
,$(strip $(call READ
,$(1))),$(REPL_ENV
))))
29 REPL
= $(info $(call REP
,$(call READLINE
,"user> ")))$(if
$(READLINE_EOF
),,$(call REPL
))
32 $(if
$(strip $(INTERACTIVE
)),$(call REPL
))