Unwrap rules storage
This commit is contained in:
parent
8702b6472b
commit
c7c5a20977
|
@ -1,4 +1,4 @@
|
||||||
<> (?x dup) (?x ?x)
|
<> (?x dup) (?x ?x)
|
||||||
<> (?x ?y swap) (?y ?x)
|
<> (?x ?y swap) (?y ?x)
|
||||||
|
|
||||||
foo ((A B swap) dup)
|
(A B swap) dup
|
|
@ -1,4 +1,4 @@
|
||||||
<> (?x dup) (?x ?x)
|
<> (?x dup) (?x ?x)
|
||||||
<> (?x ?y swap) (?y ?x)
|
<> (?x ?y swap) (?y ?x)
|
||||||
|
|
||||||
foo ((A B swap) dup)
|
(A B swap) dup
|
10
src/modal.c
10
src/modal.c
|
@ -119,8 +119,14 @@ parse_rulefrag(FILE *f)
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
char c, *origin = dict_;
|
char c, *origin = dict_;
|
||||||
while(f && fread(&c, 1, 1, f) && c && c != 0xa) {
|
while(f && fread(&c, 1, 1, f) && c && c != 0xa) {
|
||||||
if(c == '(') depth++;
|
if(c == '(') {
|
||||||
if(c == ')') --depth;
|
depth++;
|
||||||
|
if(depth == 1) continue;
|
||||||
|
}
|
||||||
|
if(c == ')') {
|
||||||
|
--depth;
|
||||||
|
if(depth == 0) continue;
|
||||||
|
}
|
||||||
if(c == ' ' && !depth) break;
|
if(c == ' ' && !depth) break;
|
||||||
*dict_++ = c;
|
*dict_++ = c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue