From 9dd3439986ca97d4ce78b9b271dc9f0c0a2a8c7e Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 17 Apr 2024 08:47:39 -0700 Subject: [PATCH] Added unpack register --- src/modal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modal.c b/src/modal.c index 71e6569..77ea3c8 100644 --- a/src/modal.c +++ b/src/modal.c @@ -65,6 +65,10 @@ put_reg(char r) for(i = 0; i < depth; i++) *dst_++ = ')'; } + } else if(r == '.') { /* unpack */ + if(*s == '(') + s++, --ss; + while(s < ss) *dst_++ = *s++; } else if(r == ':') { /* special stdout */ if(*s == '(') s++, --ss; while(s < ss) { @@ -206,7 +210,7 @@ main(int argc, char **argv) if(argc < 2) return !printf("usage: modal [-v] source.modal\n"); if(argc < 3 && argv[1][0] == '-' && argv[1][1] == 'v') - return !printf("Modal Interpreter, 16 Apr 2024.\n"); + return !printf("Modal Interpreter, 17 Apr 2024.\n"); if(!(f = fopen(argv[1], "r"))) return !fprintf(stderr, "Invalid Modal file: %s.\n", argv[1]); while(fread(&c, 1, 1, f)) {