identifiers may not contain two consecutive underscores, and a fix
authorceriel <none@none>
Thu, 31 Mar 1988 16:02:20 +0000 (16:02 +0000)
committerceriel <none@none>
Thu, 31 Mar 1988 16:02:20 +0000 (16:02 +0000)
lang/m2/comp/LLlex.c

index 3337102..d1ae5f1 100644 (file)
@@ -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);