From 88339326e859d8ba80d5a7ded5c77790f9567fff Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez Date: Thu, 14 Nov 2024 21:59:17 +0100 Subject: [PATCH] basic: move symbols and unchanged types from eval_ast to eval --- impls/basic/step2_eval.in.bas | 33 ++++++++++++++-------------- impls/basic/step3_env.in.bas | 33 ++++++++++++++-------------- impls/basic/step4_if_fn_do.in.bas | 33 ++++++++++++++-------------- impls/basic/step5_tco.in.bas | 33 ++++++++++++++-------------- impls/basic/step6_file.in.bas | 33 ++++++++++++++-------------- impls/basic/step7_quote.in.bas | 33 ++++++++++++++-------------- impls/basic/step8_macros.in.bas | 36 ++++++++++++++++--------------- impls/basic/step9_try.in.bas | 36 ++++++++++++++++--------------- impls/basic/stepA_mal.in.bas | 36 ++++++++++++++++--------------- 9 files changed, 159 insertions(+), 147 deletions(-) diff --git a/impls/basic/step2_eval.in.bas b/impls/basic/step2_eval.in.bas index 38dec57333..f3501d1bfa 100755 --- a/impls/basic/step2_eval.in.bas +++ b/impls/basic/step2_eval.in.bas @@ -19,21 +19,8 @@ SUB EVAL_AST IF ER<>-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_RETURN + EVAL_NOT_LIST: + B$="DEBUG-EVAL":CALL ENV_GET IF R3=0 OR R=0 OR R=2 THEN GOTO DEBUG_EVAL_DONE AZ=A:B=1:GOSUB PR_STR PRINT "EVAL: "+R$+" [A:"+STR$(A)+", LV:"+STR$(LV)+"]" DEBUG_EVAL_DONE: - GOSUB LIST_Q - IF R THEN GOTO APPLY_LIST - EVAL_NOT_LIST: + GOSUB TYPE_A + T=T-4 + IF 0-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_RETURN + EVAL_NOT_LIST: + B$="DEBUG-EVAL":CALL ENV_GET IF R3=0 OR R=0 OR R=2 THEN GOTO DEBUG_EVAL_DONE AZ=A:B=1:GOSUB PR_STR PRINT "EVAL: "+R$+" [A:"+STR$(A)+", LV:"+STR$(LV)+"]" DEBUG_EVAL_DONE: - GOSUB LIST_Q - IF R THEN GOTO APPLY_LIST - EVAL_NOT_LIST: + GOSUB TYPE_A + T=T-4 + IF 0-2 THEN GOTO EVAL_AST_RETURN GOSUB TYPE_A - IF T=5 THEN GOTO EVAL_AST_SYMBOL - IF T>5 AND T<9 THEN GOTO EVAL_AST_SEQ + IF T<6 OR 8-2 THEN GOTO EVAL_RETURN + EVAL_NOT_LIST: + B$="DEBUG-EVAL":CALL ENV_GET IF R3=0 OR R=0 OR R=2 THEN GOTO DEBUG_EVAL_DONE AZ=A:B=1:GOSUB PR_STR PRINT "EVAL: "+R$+" [A:"+STR$(A)+", LV:"+STR$(LV)+"]" DEBUG_EVAL_DONE: - GOSUB LIST_Q - IF R THEN GOTO APPLY_LIST - EVAL_NOT_LIST: + GOSUB TYPE_A + T=T-4 + IF 0