Added tests, ignoring empty rules
This commit is contained in:
parent
b0f9ba84e3
commit
d520ab8489
|
@ -88,12 +88,15 @@ reverse (modal) = ladom (reverse 1) test
|
||||||
|
|
||||||
?(?-) (Incomplete definitions)
|
?(?-) (Incomplete definitions)
|
||||||
|
|
||||||
|
<> <>
|
||||||
|
<> () ()
|
||||||
<> (incomplete-basic)
|
<> (incomplete-basic)
|
||||||
<> (incomplete-reg ?x)
|
<> (incomplete-reg ?x)
|
||||||
<> (waste-rule) *
|
<> (waste-rule) *
|
||||||
|
|
||||||
(incomplete-basic) = () (incomplete 1) test
|
(incomplete-basic) = () (incomplete 1) test
|
||||||
(incomplete-reg abcdef) = () (incomplete 2) test
|
(incomplete-reg abcdef) = () (incomplete 2) test
|
||||||
|
(?(?x) incomplete-lambda) = () (incomplete 3) test
|
||||||
|
|
||||||
?(?-) (Inline rules)
|
?(?-) (Inline rules)
|
||||||
|
|
||||||
|
|
|
@ -228,11 +228,14 @@ rewrite(void)
|
||||||
Rule *r = NULL;
|
Rule *r = NULL;
|
||||||
/* phase: define */
|
/* phase: define */
|
||||||
if(c == '<' && s[1] == '>') {
|
if(c == '<' && s[1] == '>') {
|
||||||
r = rules_++;
|
r = rules_;
|
||||||
s = compile_rule(r, rules_ - rules - 1, s + 2);
|
s = compile_rule(r, rules_ - rules - 1, s + 2);
|
||||||
|
if(*r->a) {
|
||||||
if(!quiet && r->a)
|
if(!quiet && r->a)
|
||||||
printf("<> "), echo_rule(r, r->a), echo_rule(r, r->b), putc('\n', stdout);
|
printf("<> "), echo_rule(r, r->a), echo_rule(r, r->b), putc('\n', stdout);
|
||||||
while(*s == ' ') s++;
|
while(*s == ' ') s++;
|
||||||
|
rules_++;
|
||||||
|
}
|
||||||
return write_tail(s);
|
return write_tail(s);
|
||||||
}
|
}
|
||||||
/* phase: undefine */
|
/* phase: undefine */
|
||||||
|
|
Loading…
Reference in New Issue