Write empty register name when null
This commit is contained in:
parent
865f040da3
commit
66bd58b89b
|
@ -5,5 +5,7 @@
|
||||||
<> (reverse/l (?h) ?l) (str (?h ?l))
|
<> (reverse/l (?h) ?l) (str (?h ?l))
|
||||||
<> (implode str ?*) (?*)
|
<> (implode str ?*) (?*)
|
||||||
<> ((read)) (?:)
|
<> ((read)) (?:)
|
||||||
|
<> (empty-register) (?x)
|
||||||
|
<> (explode ?*) (str (?*))
|
||||||
|
|
||||||
(implode reverse (explode hello)) (read)
|
(implode reverse (explode hello)) (read) (explode hello) empty-register
|
|
@ -105,7 +105,6 @@ commit(char r)
|
||||||
{
|
{
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
char c, *s = regs[(int)r];
|
char c, *s = regs[(int)r];
|
||||||
if(!s) return !fprintf(stderr, "?%c Empty\n", r);
|
|
||||||
if(r == '*')
|
if(r == '*')
|
||||||
s = plode(s);
|
s = plode(s);
|
||||||
else if(s[0] == '(') {
|
else if(s[0] == '(') {
|
||||||
|
@ -184,7 +183,7 @@ rewrite(void)
|
||||||
if(res != NULL) {
|
if(res != NULL) {
|
||||||
char cc, *b = r->b;
|
char cc, *b = r->b;
|
||||||
while((cc = *b++)) {
|
while((cc = *b++)) {
|
||||||
if(cc == '?')
|
if(cc == '?' && regs[(int)b[0]])
|
||||||
commit(*b++);
|
commit(*b++);
|
||||||
else
|
else
|
||||||
*outp_++ = cc;
|
*outp_++ = cc;
|
||||||
|
|
Loading…
Reference in New Issue