Support raise with no parameters.

This commit is contained in:
Fred Drake 1998-04-10 04:43:28 +00:00
parent a239880a22
commit c542bc79c8
1 changed files with 4 additions and 3 deletions

View File

@ -1469,11 +1469,12 @@ validate_raise_stmt(tree)
{
int nch = NCH(tree);
int res = (validate_ntype(tree, raise_stmt)
&& ((nch == 2) || (nch == 4) || (nch == 6)));
&& ((nch == 1) || (nch == 2) || (nch == 4) || (nch == 6)));
if (res) {
res = (validate_name(CHILD(tree, 0), "raise")
&& validate_test(CHILD(tree, 1)));
res = validate_name(CHILD(tree, 0), "raise");
if (res && (nch >= 2))
res = validate_test(CHILD(tree, 1));
if (res && nch > 2) {
res = (validate_comma(CHILD(tree, 2))
&& validate_test(CHILD(tree, 3)));