Simpler plode

This commit is contained in:
Devine Lu Linvega 2024-04-11 10:02:53 -07:00
parent 819ea2f1fa
commit a890215143
1 changed files with 4 additions and 5 deletions

View File

@ -34,13 +34,12 @@ static char *
plode(char *s)
{
int i, depth = 0;
char c;
char c, *ss;
if(s[0] == '(') { /* implode */
while((c = *s++)) {
if(c == '(') depth++;
ss = walk(s);
while(s < ss) {
c = *(s++);
if(!spacer(c)) *outp_++ = c;
if(c == ')') --depth;
if(!depth) return s;
}
} else { /* explode */
while((c = *s++) && !spacer(c))