1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-19 09:38:28 +03:00

make: move macro attr to fn rather than in env.

This commit is contained in:
Joel Martin 2017-10-24 09:29:51 -05:00
parent 677cfe0c18
commit 14a5c0d8bc
3 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ $(strip \
endef
define IS_MACRO_CALL
$(if $(call _list?,$(1)),$(call ENV_FIND,$(2),_macro_$($(call _nth,$(1),0)_value)),)
$(if $(call _list?,$(1)),$(if $(call ENV_FIND,$(2),$($(call _nth,$(1),0)_value)),$(_macro_$(call ENV_GET,$(2),$($(call _nth,$(1),0)_value))),),)
endef
define MACROEXPAND
@ -96,7 +96,7 @@ $(if $(__ERROR),,\
$(foreach a1,$(call _nth,$(1),1),\
$(foreach a2,$(call _nth,$(1),2),\
$(foreach res,$(call EVAL,$(a2),$(2)),\
$(if $(call ENV_SET,$(2),_macro_$($(a1)_value),true),,)\
$(eval _macro_$(res) = true)\
$(if $(call ENV_SET,$(2),$($(a1)_value),$(res)),$(res),)))),\
$(if $(call _EQ,macroexpand,$($(a0)_value)),\
$(call MACROEXPAND,$(call _nth,$(1),1),$(2)),\

View File

@ -32,7 +32,7 @@ $(strip \
endef
define IS_MACRO_CALL
$(if $(call _list?,$(1)),$(call ENV_FIND,$(2),_macro_$($(call _nth,$(1),0)_value)),)
$(if $(call _list?,$(1)),$(if $(call ENV_FIND,$(2),$($(call _nth,$(1),0)_value)),$(_macro_$(call ENV_GET,$(2),$($(call _nth,$(1),0)_value))),),)
endef
define MACROEXPAND
@ -96,7 +96,7 @@ $(if $(__ERROR),,\
$(foreach a1,$(call _nth,$(1),1),\
$(foreach a2,$(call _nth,$(1),2),\
$(foreach res,$(call EVAL,$(a2),$(2)),\
$(if $(call ENV_SET,$(2),_macro_$($(a1)_value),true),,)\
$(eval _macro_$(res) = true)\
$(if $(call ENV_SET,$(2),$($(a1)_value),$(res)),$(res),)))),\
$(if $(call _EQ,macroexpand,$($(a0)_value)),\
$(call MACROEXPAND,$(call _nth,$(1),1),$(2)),\

View File

@ -32,7 +32,7 @@ $(strip \
endef
define IS_MACRO_CALL
$(if $(call _list?,$(1)),$(call ENV_FIND,$(2),_macro_$($(call _nth,$(1),0)_value)),)
$(if $(call _list?,$(1)),$(if $(call ENV_FIND,$(2),$($(call _nth,$(1),0)_value)),$(_macro_$(call ENV_GET,$(2),$($(call _nth,$(1),0)_value))),),)
endef
define MACROEXPAND
@ -96,7 +96,7 @@ $(if $(__ERROR),,\
$(foreach a1,$(call _nth,$(1),1),\
$(foreach a2,$(call _nth,$(1),2),\
$(foreach res,$(call EVAL,$(a2),$(2)),\
$(if $(call ENV_SET,$(2),_macro_$($(a1)_value),true),,)\
$(eval _macro_$(res) = true)\
$(if $(call ENV_SET,$(2),$($(a1)_value),$(res)),$(res),)))),\
$(if $(call _EQ,macroexpand,$($(a0)_value)),\
$(call MACROEXPAND,$(call _nth,$(1),1),$(2)),\