Fixed issue with wrapped cells
This commit is contained in:
parent
f51040de77
commit
258fd27a9c
|
@ -1,5 +1,4 @@
|
|||
<> (dup ?x) (?x ?x)
|
||||
<> (?x ?y swap) (?y ?x)
|
||||
|
||||
((hey) (there) swap)
|
||||
(dup (123))
|
||||
|
||||
|
|
16
src/modal.c
16
src/modal.c
|
@ -20,8 +20,11 @@ walk(char *s)
|
|||
char c;
|
||||
while((c = *s++)) {
|
||||
if(c == '(') depth++;
|
||||
if(c == ')') --depth;
|
||||
if(spacer(c) && !depth) break;
|
||||
if(c == ')') {
|
||||
--depth;
|
||||
if(!depth) break;
|
||||
}
|
||||
if(depth < 0) break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
@ -46,10 +49,13 @@ writereg(char r)
|
|||
int depth = 0;
|
||||
char c, *s = regs[(int)r];
|
||||
while((c = *s++)) {
|
||||
*outp_++ = c;
|
||||
if(c == '(') depth++;
|
||||
if(c == ')') --depth;
|
||||
if(!depth) break;
|
||||
if(c == ')') {
|
||||
--depth;
|
||||
if(!depth) break;
|
||||
}
|
||||
if(depth < 0) break;
|
||||
*outp_++ = c;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue