From 5ce30d41c3ce7d63d90fc09b9ec3a34a97437e1d Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 14 Feb 2023 10:23:23 -0800 Subject: [PATCH] Regularize defs.txt. All three main interpreters use the same defs.txt file. --- implementations/C/Makefile | 3 +++ implementations/C/definitions.c | 4 ++-- implementations/C/defs.txt | 4 ++-- implementations/Nim/defs.txt | 4 ++-- implementations/defs.txt | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/implementations/C/Makefile b/implementations/C/Makefile index 97886a3..37cf42c 100644 --- a/implementations/C/Makefile +++ b/implementations/C/Makefile @@ -16,6 +16,9 @@ joy: ${OBJS} $(STATIC_GCLIB) joy.o: joy.h definitions.h +defs.txt: ../defs.txt + cp -fv ../defs.txt defs.txt + definitions.c: defs.txt convert_defs.py python convert_defs.py > $@ diff --git a/implementations/C/definitions.c b/implementations/C/definitions.c index 62ec5b5..7f64bc1 100644 --- a/implementations/C/definitions.c +++ b/implementations/C/definitions.c @@ -272,8 +272,8 @@ init_defs(void) def__map1_body = text_to_expression("stackd shift"); def__map2_body = text_to_expression("[infrst] cons dipd roll< swons"); def___REVERSE_SOLIDUS_SOLIDUS___body = text_to_expression("[not not] [not] branch"); - def_SOLIDUS_REVERSE_SOLIDUS_body = text_to_expression("[pop false] [not not] branch"); - def_REVERSE_SOLIDUS_SOLIDUS_body = text_to_expression("[not not] [pop true] branch"); + def_SOLIDUS_REVERSE_SOLIDUS_body = text_to_expression("[not not] ii [pop false] [] branch"); + def_REVERSE_SOLIDUS_SOLIDUS_body = text_to_expression("[not not] ii [] [pop true] branch"); } diff --git a/implementations/C/defs.txt b/implementations/C/defs.txt index 8767ffb..eb69b20 100644 --- a/implementations/C/defs.txt +++ b/implementations/C/defs.txt @@ -127,5 +127,5 @@ _map0 [_map1] dipd _map2 _map1 stackd shift _map2 [infrst] cons dipd roll< swons _\/_ [not not] [not] branch -/\ [pop false] [not not] branch -\/ [not not] [pop true] branch \ No newline at end of file +/\ [not not] ii [pop false] [] branch +\/ [not not] ii [] [pop true] branch \ No newline at end of file diff --git a/implementations/Nim/defs.txt b/implementations/Nim/defs.txt index 4743668..eb69b20 100644 --- a/implementations/Nim/defs.txt +++ b/implementations/Nim/defs.txt @@ -127,5 +127,5 @@ _map0 [_map1] dipd _map2 _map1 stackd shift _map2 [infrst] cons dipd roll< swons _\/_ [not not] [not] branch -/\ [not not ] ii [pop false] [] branch -\/ [not not ] ii [] [pop true] branch \ No newline at end of file +/\ [not not] ii [pop false] [] branch +\/ [not not] ii [] [pop true] branch \ No newline at end of file diff --git a/implementations/defs.txt b/implementations/defs.txt index 4743668..eb69b20 100644 --- a/implementations/defs.txt +++ b/implementations/defs.txt @@ -127,5 +127,5 @@ _map0 [_map1] dipd _map2 _map1 stackd shift _map2 [infrst] cons dipd roll< swons _\/_ [not not] [not] branch -/\ [not not ] ii [pop false] [] branch -\/ [not not ] ii [] [pop true] branch \ No newline at end of file +/\ [not not] ii [pop false] [] branch +\/ [not not] ii [] [pop true] branch \ No newline at end of file