make: revert/correct fix for plain undef symbol.
authorJoel Martin <github@martintribe.org>
Fri, 2 Aug 2019 17:44:22 +0000 (12:44 -0500)
committerJoel Martin <github@martintribe.org>
Fri, 2 Aug 2019 17:44:22 +0000 (12:44 -0500)
The return value from _error was causing some breakage in other error
handling. Instead, return a value from the spot where the undefined
symbol error is set. This achieves the desired fix without breaking
other unclosed sequence errors.

make/env.mk
make/types.mk

index d508283..c8f8792 100644 (file)
@@ -43,7 +43,7 @@ ENV_FIND = $(strip \
                  ,\
                  $(call ENV_FIND,$(call _get,$(1),__outer__),$(2)))))
 
-ENV_GET = $(foreach env,|$(call ENV_FIND,$(1),$(2))|,$(if $(call _EQ,||,$(env)),$(call _error,'$(2)' not found),$(call _get,$(strip $(subst |,,$(env))),$(subst =,$(__equal),$(2)))))
+ENV_GET = $(foreach env,|$(call ENV_FIND,$(1),$(2))|,$(if $(call _EQ,||,$(env)),$(call _error,'$(2)' not found)$(__nil),$(call _get,$(strip $(subst |,,$(env))),$(subst =,$(__equal),$(2)))))
 
 ENV_SET = $(if $(call _assoc!,$(1),$(subst =,$(__equal),$(2)),$(3)),$(1),)
 
index 7424cf7..ba2aeb5 100644 (file)
@@ -68,6 +68,11 @@ __var_print = $(foreach v,$(1),\
 _visualize_memory = $(foreach var,$(sort $(foreach vv,$(filter $(__obj_magic)_%,$(.VARIABLES)),$(call __var_name,$(vv)))),$(call __var_print,$(__obj_magic)_$(var)))
 
 
+# Errors/Exceptions
+__ERROR :=
+_error = $(strip $(eval __ERROR := $(call _string,$(1))))
+
+
 # Constant atomic values
 __undefined = $(__obj_magic)_undf_0
 __nil = $(__obj_magic)__nil_0
@@ -75,11 +80,6 @@ __true = $(__obj_magic)_true_0
 __false = $(__obj_magic)_fals_0
 
 
-# Errors/Exceptions
-__ERROR :=
-_error = $(eval __ERROR := $(call _string,$(1)))$(__nil)
-
-
 # General functions
 
 # Return the type of the object (or "make" if it's not a object