Added comments for special registers

This commit is contained in:
Devine Lu Linvega 2024-04-13 16:16:47 -07:00
parent e897e59f7a
commit 70e96e9644
1 changed files with 4 additions and 2 deletions

View File

@ -48,18 +48,19 @@ put_reg(char r)
char c, *s = regs[(int)r]; char c, *s = regs[(int)r];
if(r == '~') { if(r == '~') {
char buf; char buf;
/* special stdin */
while(fread(&buf, 1, 1, stdin) && buf >= ' ') while(fread(&buf, 1, 1, stdin) && buf >= ' ')
*outp_++ = buf; *outp_++ = buf;
} else if(s) { } else if(s) {
char *ss = walk(s); char *ss = walk(s);
if(r == '*') { if(r == '*') {
/* implode */ /* special implode */
if(*s == '(') { if(*s == '(') {
ss = walk(s); ss = walk(s);
while(s < ss && (c = *s++)) while(s < ss && (c = *s++))
if(!spacer(c)) *outp_++ = c; if(!spacer(c)) *outp_++ = c;
} }
/* explode */ /* special explode */
else { else {
int i, depth = 0; int i, depth = 0;
while((c = *s++) && !spacer(c)) while((c = *s++) && !spacer(c))
@ -68,6 +69,7 @@ put_reg(char r)
*outp_++ = ')'; *outp_++ = ')';
} }
} else if(r == ':') { } else if(r == ':') {
/* special stdout */
if(*s == '(') s++, --ss; if(*s == '(') s++, --ss;
while(s < ss) { while(s < ss) {
c = *s++; c = *s++;