Unwrapped explode
This commit is contained in:
parent
98748fb44d
commit
d7f41dca3b
|
@ -1,5 +1,3 @@
|
||||||
<> (?x dup) (?x ?x)
|
<> ((explode ?*)) (?*)
|
||||||
<> (?x ?y swap) (?y ?x)
|
|
||||||
<> ( ?x pop) ()
|
|
||||||
|
|
||||||
(1 2 3) (4 5 6) swap pop dup
|
(explode hello)
|
|
@ -89,8 +89,12 @@ plode(char *s)
|
||||||
if(!depth) return s;
|
if(!depth) return s;
|
||||||
}
|
}
|
||||||
} else { /* explode */
|
} else { /* explode */
|
||||||
while((c = *s++) && !spacer(c))
|
*outp_++ = *s++, *outp_++ = ' ';
|
||||||
|
while((c = *s++) && !spacer(c)) {
|
||||||
*outp_++ = '(', *outp_++ = c, depth++;
|
*outp_++ = '(', *outp_++ = c, depth++;
|
||||||
|
if(!spacer(*s))
|
||||||
|
*outp_++ = ' ';
|
||||||
|
}
|
||||||
for(i = 0; i < depth; i++)
|
for(i = 0; i < depth; i++)
|
||||||
*outp_++ = ')';
|
*outp_++ = ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue