227 |
if (type_of(x) == t_cons) { |
if (type_of(x) == t_cons) { |
228 |
if (type_of(x->c.c_car) == t_cons) { |
if (type_of(x->c.c_car) == t_cons) { |
229 |
if (!keywordp(x->c.c_car->c.c_car)) |
if (!keywordp(x->c.c_car->c.c_car)) |
230 |
FEerror("~S is not a keyword.", |
/* FIXME better message */ |
231 |
1, x->c.c_car->c.c_car); |
FEunexpected_keyword(x->c.c_car->c.c_car); |
232 |
vs_push(x->c.c_car->c.c_car); |
vs_push(x->c.c_car->c.c_car); |
233 |
if (endp(x->c.c_car->c.c_cdr)) |
if (endp(x->c.c_car->c.c_cdr)) |
234 |
illegal_lambda(); |
illegal_lambda(); |
437 |
if (key_flag) { |
if (key_flag) { |
438 |
i = narg - nreq - nopt; |
i = narg - nreq - nopt; |
439 |
if (i >= 0 && i%2 != 0) |
if (i >= 0 && i%2 != 0) |
440 |
FEerror("Keyword values are missing.", 0); |
/* FIXME better message */ |
441 |
|
FEunexpected_keyword(Cnil); |
442 |
other_keys_appeared = FALSE; |
other_keys_appeared = FALSE; |
443 |
for (i = nreq + nopt; i < narg; i += 2) { |
for (i = nreq + nopt; i < narg; i += 2) { |
444 |
if (!keywordp(base[i])) |
if (!keywordp(base[i])) |
445 |
FEerror("~S is not a keyword.", |
FEunexpected_keyword(base[i]); |
|
1, base[i]); |
|
446 |
if (base[i] == sKallow_other_keys && |
if (base[i] == sKallow_other_keys && |
447 |
base[i+1] != Cnil) |
base[i+1] != Cnil) |
448 |
allow_other_keys_flag = TRUE; |
allow_other_keys_flag = TRUE; |
464 |
continue; |
continue; |
465 |
} |
} |
466 |
if (other_keys_appeared && !allow_other_keys_flag) |
if (other_keys_appeared && !allow_other_keys_flag) |
467 |
FEerror("Other-keys are not allowed.", 0); |
/* FIXME better message */ |
468 |
|
FEunexpected_keyword(Ct); |
469 |
} |
} |
470 |
for (i = 0; i < nkey; i++) |
for (i = 0; i < nkey; i++) |
471 |
if (keyword[i].key_svar_val != Cnil) { |
if (keyword[i].key_svar_val != Cnil) { |
729 |
return; |
return; |
730 |
} |
} |
731 |
if (narg%2 != 0) |
if (narg%2 != 0) |
732 |
FEerror("Odd number of arguments for keywords.", 0); |
/* FIXME better message */ |
733 |
|
FEunexpected_keyword(Cnil); |
734 |
if (narg == 2) { |
if (narg == 2) { |
735 |
k = base[0]; |
k = base[0]; |
736 |
if (!keywordp(k)) |
if (!keywordp(k)) |
737 |
FEerror("~S is not a keyword.", 1, k); |
FEunexpected_keyword(k); |
738 |
if (k == sKallow_other_keys && base[1] != Cnil) |
if (k == sKallow_other_keys && base[1] != Cnil) |
739 |
allow_other_keys = TRUE; |
allow_other_keys = TRUE; |
740 |
temporary = base[1]; |
temporary = base[1]; |
760 |
base[-1] = make_cons(k, temporary); |
base[-1] = make_cons(k, temporary); |
761 |
} |
} |
762 |
if (other_key != OBJNULL && !allow_other_keys) |
if (other_key != OBJNULL && !allow_other_keys) |
763 |
FEerror("The keyword ~S is not allowed.",1,other_key); |
FEunexpected_keyword(other_key); |
764 |
return; |
return; |
765 |
} |
} |
766 |
va_start(ap,n); |
va_start(ap,n); |
806 |
} |
} |
807 |
va_end(ap); |
va_end(ap); |
808 |
if (error_flag == NOT_KEYWORD) |
if (error_flag == NOT_KEYWORD) |
809 |
FEerror("~S is not a keyword.", 1, other_key); |
FEunexpected_keyword(other_key); |
810 |
if (other_key != OBJNULL && !allow_other_keys) |
if (other_key != OBJNULL && !allow_other_keys) |
811 |
FEerror("The keyword ~S is not allowed.", 1, other_key); |
FEunexpected_keyword(other_key); |
812 |
} |
} |
813 |
|
|
814 |
void |
void |
823 |
for (; !endp(l); l = l->c.c_cdr->c.c_cdr) { |
for (; !endp(l); l = l->c.c_cdr->c.c_cdr) { |
824 |
k = l->c.c_car; |
k = l->c.c_car; |
825 |
if (!keywordp(k)) |
if (!keywordp(k)) |
826 |
FEerror("~S is not a keyword.", 1, k); |
FEunexpected_keyword(k); |
827 |
if (endp(l->c.c_cdr)) |
if (endp(l->c.c_cdr)) |
828 |
FEerror("Odd number of arguments for keywords.", 0); |
/* FIXME better message */ |
829 |
|
FEunexpected_keyword(Cnil); |
830 |
if (k == sKallow_other_keys && l->c.c_cdr->c.c_car != Cnil) { |
if (k == sKallow_other_keys && l->c.c_cdr->c.c_car != Cnil) { |
831 |
allow_other_keys = TRUE; |
allow_other_keys = TRUE; |
832 |
} else { |
} else { |
841 |
} |
} |
842 |
} |
} |
843 |
if (other_key != OBJNULL && !allow_other_keys) |
if (other_key != OBJNULL && !allow_other_keys) |
844 |
FEerror("The keyword ~S is not allowed or is duplicated.", |
FEunexpected_keyword(other_key); |
|
1, other_key); |
|
845 |
} |
} |
846 |
|
|
847 |
|
|
895 |
m -= 2;} |
m -= 2;} |
896 |
if (allow) n = n -2 ; else goto error;} |
if (allow) n = n -2 ; else goto error;} |
897 |
} |
} |
898 |
if (n!=0) FEerror("Odd number of keys",0); |
/* FIXME better message */ |
899 |
|
if (n!=0) FEunexpected_keyword(Cnil); |
900 |
return 0; |
return 0; |
901 |
error: |
error: |
902 |
FEerror("Unrecognized key ~a",1,k); |
FEunexpected_keyword(k); |
903 |
return -1; |
return -1; |
904 |
}}} |
}}} |
905 |
|
|
951 |
if (allow) n = n -2 ; else goto error;} |
if (allow) n = n -2 ; else goto error;} |
952 |
|
|
953 |
} |
} |
954 |
if (n!=0) FEerror("Odd number of keys",0); |
/* FIXME better message */ |
955 |
|
if (n!=0) FEunexpected_keyword(Cnil); |
956 |
return 0; |
return 0; |
957 |
error: |
error: |
958 |
FEerror("Unrecognized key ~a",1,k); |
FEunexpected_keyword(k); |
959 |
return -1; |
return -1; |
960 |
}}} |
}}} |
961 |
|
|