aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShinya Sato <shinnya.sato@gmail.com>2022-02-24 14:24:33 +0900
committerShinya Sato <shinnya.sato@gmail.com>2022-02-24 14:24:33 +0900
commitdba967f211b337a18c8edfecd79457f8f76d771b (patch)
treef43f002b20b142bd983325b60f43862cc20375df /src
parentcba576f73e8ee7e27c95ae6f7d84882df54b7d37 (diff)
parent85872e2da9e2616670f1920894d25d577c8b55f7 (diff)
downloadinpla-dba967f211b337a18c8edfecd79457f8f76d771b.tar.gz
inpla-dba967f211b337a18c8edfecd79457f8f76d771b.zip
Merge branch 'develop'
Diffstat (limited to 'src')
-rw-r--r--src/inpla.y29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/inpla.y b/src/inpla.y
index 3550102..87e39b8 100644
--- a/src/inpla.y
+++ b/src/inpla.y
@@ -49,8 +49,8 @@
//#define COUNT_MKAGENT // count of execution fo mkagent
-#define VERSION "0.7.3"
-#define BUILT_DATE "20 Feb. 2022"
+#define VERSION "0.7.3-1"
+#define BUILT_DATE "24 Feb. 2022"
// ------------------------------------------------------------------
@@ -4881,8 +4881,11 @@ void Ast_make_annotation_TailRecursionOptimisation(Ast *mainbody) {
Ast *agent_TRO = NULL;
AST_ID astID_of_TRO = idL; // idL is dummy
+
+ if (mainbody == NULL)
+ return;
- if ((mainbody == NULL) || (mainbody->id == AST_BODY)) {
+ if (mainbody->id == AST_BODY) {
Ast *body = mainbody;
// int idR = CmEnv.idR;
@@ -7478,9 +7481,9 @@ void *exec_code(int mode, VirtualMachine * restrict vm, void * restrict *code) {
VALUE a2 = NAME(a1)->port;
free_Name(a1);
a1 = a2;
+ reg[(unsigned long)code[pc+1]] = a1;
}
- reg[(unsigned long)code[pc+1]] = a1;
if (BASIC(a1)->id == (unsigned long)code[pc+2]) {
#ifdef COUNT_CNCT
@@ -7551,6 +7554,7 @@ void *exec_code(int mode, VirtualMachine * restrict vm, void * restrict *code) {
E_CNCTGN:
// puts("CNCTGN reg reg");
// "x"~s, "x"->t ==> push(s,t), free("x") where "x" is a global name.
+ /*
{
pc++;
VALUE x = reg[(unsigned long)code[pc++]];
@@ -7559,7 +7563,22 @@ void *exec_code(int mode, VirtualMachine * restrict vm, void * restrict *code) {
PUSH(vm, reg[(unsigned long)code[pc++]], a1);
}
goto *code[pc];
-
+ */
+ {
+ VALUE x = reg[(unsigned long)code[pc+1]];
+ a1 = NAME(x)->port;
+ free_Name(x);
+ VALUE t = reg[(unsigned long)code[pc+2]];
+
+ puts("============================================");
+ puts_term(t);printf("\n~");puts_term(a1);puts("");
+ puts("============================================");
+
+ PUSH(vm, t, a1);
+ }
+ pc +=3;
+ goto *code[pc];
+
E_SUBSTGN: