Catch empty rules
This commit is contained in:
parent
e80db68aa6
commit
4a57c3c564
|
@ -81,7 +81,8 @@ abc ?(?x) def = abc (lambda 2/2) test
|
||||||
|
|
||||||
<> (incomplete-basic)
|
<> (incomplete-basic)
|
||||||
<> (incomplete-reg ?x)
|
<> (incomplete-reg ?x)
|
||||||
<> (waste-rule) *
|
<> <>
|
||||||
|
<> () ()
|
||||||
|
|
||||||
(incomplete-basic) = () (incomplete 1/4) test
|
(incomplete-basic) = () (incomplete 1/4) test
|
||||||
(incomplete-reg abcdef) = () (incomplete 2/4) test
|
(incomplete-reg abcdef) = () (incomplete 2/4) test
|
||||||
|
|
|
@ -226,7 +226,7 @@ parse_frag(char **side, char *s)
|
||||||
{
|
{
|
||||||
char c, *cap;
|
char c, *cap;
|
||||||
while((c = *s) && c == ' ') s++;
|
while((c = *s) && c == ' ') s++;
|
||||||
if(c == ')' || (c == '<' || c == '>'))
|
if(c == ')' || c == '<' || c == '>' || (c == '(' && s[1] == ')'))
|
||||||
*side = NULL;
|
*side = NULL;
|
||||||
else {
|
else {
|
||||||
cap = walk(s), *side = dict_;
|
cap = walk(s), *side = dict_;
|
||||||
|
@ -315,7 +315,7 @@ main(int argc, char **argv)
|
||||||
return !printf("usage: modal [-vqn] source.modal\n");
|
return !printf("usage: modal [-vqn] source.modal\n");
|
||||||
for(i = 1; i < argc && *argv[i] == '-'; i++) {
|
for(i = 1; i < argc && *argv[i] == '-'; i++) {
|
||||||
switch(argv[i][1]) {
|
switch(argv[i][1]) {
|
||||||
case 'v': /* version */ return !printf("Modal Interpreter, 9 May 2024.\n");
|
case 'v': /* version */ return !printf("Modal Interpreter, 10 May 2024.\n");
|
||||||
case 'q': /* quiet */ quiet = 1; break;
|
case 'q': /* quiet */ quiet = 1; break;
|
||||||
case 'p': /* debug */ debug = 1; break;
|
case 'p': /* debug */ debug = 1; break;
|
||||||
case 'a': /* access */ access = 1; break;
|
case 'a': /* access */ access = 1; break;
|
||||||
|
|
Loading…
Reference in New Issue