From: ceriel Date: Thu, 31 Mar 1988 16:02:20 +0000 (+0000) Subject: identifiers may not contain two consecutive underscores, and a fix X-Git-Tag: release-5-5~3527 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=702a73b73445e9d7982cc5ac84cc5121ebd9e9eb;p=ack.git identifiers may not contain two consecutive underscores, and a fix --- diff --git a/lang/m2/comp/LLlex.c b/lang/m2/comp/LLlex.c index 3337102b3..d1ae5f18a 100644 --- a/lang/m2/comp/LLlex.c +++ b/lang/m2/comp/LLlex.c @@ -348,6 +348,9 @@ again: register t_idf *id; do { + if (ch == '_' && *tag == '_') { + lexerror("an identifier may not contain two consecutive underscores"); + } if (tag - buf < idfsize) *tag++ = ch; LoadChar(ch); } while(in_idf(ch)); @@ -356,7 +359,7 @@ again: else PushBack(); *tag = '\0'; if (*(tag - 1) == '_') { - lexerror("last character of an identifier may not be a '_'"); + lexerror("last character of an identifier may not be an underscore"); } tk->TOK_IDF = id = str2idf(buf, 1);