From: ceriel Date: Mon, 26 Jan 1987 16:14:39 +0000 (+0000) Subject: Added a check that a tokenset in a stackpattern contains tokens X-Git-Tag: release-5-5~4944 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=edae1fc950b8fe2aab31d57afa8d3aa134ac3517;p=ack.git Added a check that a tokenset in a stackpattern contains tokens that all have the same size. --- diff --git a/util/ncgg/cgg.y b/util/ncgg/cgg.y index 1edca6219..8c1974e94 100644 --- a/util/ncgg/cgg.y +++ b/util/ncgg/cgg.y @@ -20,6 +20,7 @@ int startline; int npatterns; int att_type; int patindex[MAXPATTERNS]; +extern set_t l_sets[]; int emhere=0; /* lexical analyzer flag */ int optexact=0; /* Inside "with exact" rule */ @@ -742,6 +743,9 @@ setlist { NEXT(tokpatlen,TOKPATMAX,"Stack pattern"); tokpatset[tokpatlen-1] = $2; checkunstacking($2); + if (l_sets[$2].set_size == 0) { + error("Tokenset is empty or has elements with different sizes"); + } } ; kills