diff --git a/examples/test.modal b/examples/test.modal index 1e92471..6f577f2 100644 --- a/examples/test.modal +++ b/examples/test.modal @@ -1,4 +1,4 @@ -<> (?x dup) (?x ?x) -<> (?x ?y swap) (?y ?x) +<> (?x dup) (?x ?x) +<> (?x ?y swap) (?y ?x) (A B swap) dup \ No newline at end of file diff --git a/src/modal.c b/src/modal.c index f399099..9c818c6 100644 --- a/src/modal.c +++ b/src/modal.c @@ -116,9 +116,11 @@ print_rules(void) static char * parse_rulefrag(FILE *f) { - int depth = 0; + int depth = 0, trim = 0; char c, *origin = dict_; while(f && fread(&c, 1, 1, f) && c && c != 0xa) { + if(c == ' ' && !trim) continue; + trim = 1; if(c == '(') { depth++; if(depth == 1) continue;