• R/O
  • SSH
  • HTTPS

jpl: Commit


Commit MetaInfo

Revision482 (tree)
Time2019-03-10 07:55:44
Authorjakobthomsen

Log Message

oninput construct

Change Summary

Incremental Difference

--- trunk/experimental2/compiler.compiled.c (revision 481)
+++ trunk/experimental2/compiler.compiled.c (revision 482)
@@ -905,17 +905,56 @@
905905 }
906906 printf("*/");
907907
908- uint64_t dest = --tmpaddr;
909- printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
910- printf(" stack_push(&callstack, stackframe);\n");
911- printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
912- printf(" result = 0;\n");
913- printf(" break;\n");
914- printf(" }\n");
915- //printf(" case %lluLLU:\n", (unsigned long long)--tmpaddr);
916- printf(" case %lluLLU:\n", (long long)dest); // use negative to display numbers concisely
917- printf(" {\n");
918- printf(" result = stack_pop(&callstack);\n");
908+ if(31365121518368116LLU == id)
909+ {
910+ uint64_t dest = --tmpaddr;
911+ printf("\n stack_push(&callstack, 0);"); // push unit to be popped returning from called function
912+ printf("\n memory[tuple2_access0(stackframe)].value = %lluLLU;", (long long)dest); // use negative to display numbers concisely
913+ printf("\n break;");
914+ printf("\n }");
915+ printf("\n case %lluLLU:", (long long)dest); // use negative to display numbers concisely
916+ printf("\n {");
917+ printf("\n /*unit*/(void)stack_pop(&callstack);");
918+ printf("\n if((unsigned int)ungetc(getchar(), stdin) <= 255)");
919+ printf("\n {");
920+
921+ while(isspace(c)) c = (uint32_t)getchar(); // skip WS
922+ if(isalpha(c))
923+ {
924+ printf("/*");
925+ id = 0;
926+ while(isalpha(c))
927+ {
928+ printf("%c", (char)c);
929+ id <<= 8;
930+ id |= (uint64_t)(c & 255);
931+ c = (uint32_t)getchar();
932+ }
933+ printf("*/");
934+ }
935+
936+ printf("\n memory[tuple2_access0(stackframe)].value = %lluLLU;", (long long)dest); // use negative to display numbers concisely
937+ printf("\n stack_push(&callstack, stackframe);");
938+ printf("\n stackframe = tuple2_alloc(%lluLLU, (uint64_t)getchar());", (unsigned long long)id); // echo label
939+ printf("\n result = 0;");
940+ printf("\n break;");
941+ printf("\n }");
942+ printf("\n");
943+ }
944+ else
945+ {
946+ uint64_t dest = --tmpaddr;
947+ printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
948+ printf(" stack_push(&callstack, stackframe);\n");
949+ printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
950+ printf(" result = 0;\n");
951+ printf(" break;\n");
952+ printf(" }\n");
953+ //printf(" case %lluLLU:\n", (unsigned long long)--tmpaddr);
954+ printf(" case %lluLLU:\n", (long long)dest); // use negative to display numbers concisely
955+ printf(" {\n");
956+ printf(" result = stack_pop(&callstack);\n");
957+ }
919958 }
920959 else if(64 == c)
921960 {
--- trunk/experimental2/compiler.source.c (revision 481)
+++ trunk/experimental2/compiler.source.c (revision 482)
@@ -515,17 +515,56 @@
515515 }
516516 printf("*/");
517517
518- uint64_t dest = --tmpaddr;
519- printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
520- printf(" stack_push(&callstack, stackframe);\n");
521- printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
522- printf(" result = 0;\n");
523- printf(" break;\n");
524- printf(" }\n");
525- //printf(" case %lluLLU:\n", (unsigned long long)--tmpaddr);
526- printf(" case %lluLLU:\n", (long long)dest); // use negative to display numbers concisely
527- printf(" {\n");
528- printf(" result = stack_pop(&callstack);\n");
518+ if(31365121518368116LLU == id)
519+ {
520+ uint64_t dest = --tmpaddr;
521+ printf("\n stack_push(&callstack, 0);"); // push unit to be popped returning from called function
522+ printf("\n memory[tuple2_access0(stackframe)].value = %lluLLU;", (long long)dest); // use negative to display numbers concisely
523+ printf("\n break;");
524+ printf("\n }");
525+ printf("\n case %lluLLU:", (long long)dest); // use negative to display numbers concisely
526+ printf("\n {");
527+ printf("\n /*unit*/(void)stack_pop(&callstack);");
528+ printf("\n if((unsigned int)ungetc(getchar(), stdin) <= 255)");
529+ printf("\n {");
530+
531+ while(isspace(c)) c = (uint32_t)getchar(); // skip WS
532+ if(isalpha(c))
533+ {
534+ printf("/*");
535+ id = 0;
536+ while(isalpha(c))
537+ {
538+ printf("%c", (char)c);
539+ id <<= 8;
540+ id |= (uint64_t)(c & 255);
541+ c = (uint32_t)getchar();
542+ }
543+ printf("*/");
544+ }
545+
546+ printf("\n memory[tuple2_access0(stackframe)].value = %lluLLU;", (long long)dest); // use negative to display numbers concisely
547+ printf("\n stack_push(&callstack, stackframe);");
548+ printf("\n stackframe = tuple2_alloc(%lluLLU, (uint64_t)getchar());", (unsigned long long)id); // echo label
549+ printf("\n result = 0;");
550+ printf("\n break;");
551+ printf("\n }");
552+ printf("\n");
553+ }
554+ else
555+ {
556+ uint64_t dest = --tmpaddr;
557+ printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
558+ printf(" stack_push(&callstack, stackframe);\n");
559+ printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
560+ printf(" result = 0;\n");
561+ printf(" break;\n");
562+ printf(" }\n");
563+ //printf(" case %lluLLU:\n", (unsigned long long)--tmpaddr);
564+ printf(" case %lluLLU:\n", (long long)dest); // use negative to display numbers concisely
565+ printf(" {\n");
566+ printf(" result = stack_pop(&callstack);\n");
567+ }
529568 }
530569 else if(64 == c)
531570 {
Show on old repository browser