wire in '.' as include/define intro character
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 13 Mar 1990 01:37:26 +0000 (17:37 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 13 Mar 1990 01:37:26 +0000 (17:37 -0800)
SCCS-vsn: usr.bin/make/cond.c 5.5
SCCS-vsn: usr.bin/make/config.h 5.6
SCCS-vsn: usr.bin/make/parse.c 5.4

usr/src/usr.bin/make/cond.c
usr/src/usr.bin/make/config.h
usr/src/usr.bin/make/parse.c

index 4d591da..0b6fbbd 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)cond.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)cond.c     5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -1011,20 +1011,7 @@ Cond_Eval (line)
     Boolean        value;
     int                    level;      /* Level at which to report errors. */
 
     Boolean        value;
     int                    level;      /* Level at which to report errors. */
 
-    /*
-     * Set the error level. When SPECIAL_CHAR is #, there is an ambiguity
-     * because of the need to keep # as the comment character. In such a case
-     * it is impossible to tell, for example, if the user has simply begun
-     * a commented sentence with "else" or has forgotten the initial "if".
-     * For this reason, we make the errors only warnings. If the lead-in
-     * character is anything else, however, we can be certain the user
-     * is in error.
-     */
-#if SPECIAL_CHAR == '#'
-    level = PARSE_WARNING;
-#else
     level = PARSE_FATAL;
     level = PARSE_FATAL;
-#endif
 
     for (line++; *line == ' ' || *line == '\t'; line++) {
        continue;
 
     for (line++; *line == ' ' || *line == '\t'; line++) {
        continue;
index addb7ba..d828724 100644 (file)
@@ -19,7 +19,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)config.h    5.5 (Berkeley) %G%
+ *     @(#)config.h    5.6 (Berkeley) %G%
  */
 
 #define        DEFSHELL        1                       /* Bourne shell */
  */
 
 #define        DEFSHELL        1                       /* Bourne shell */
 #define INCLUDES
 #define LIBRARIES
 
 #define INCLUDES
 #define LIBRARIES
 
-/*
- * SPECIAL_CHAR
- *     The character that leads into conditionals and include directives
- *     and the like.
- */
-#define SPECIAL_CHAR '#'
-
 /*
  * DEF_OLD_VARS
  *     If defined, variable substitution follows the make style. PMake-style
 /*
  * DEF_OLD_VARS
  *     If defined, variable substitution follows the make style. PMake-style
index a2c9c47..63e37d9 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parse.c    5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)parse.c    5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -1574,8 +1574,7 @@ ParseDoInclude (file)
 
     if (*cp != endc) {
        Parse_Error (PARSE_FATAL,
 
     if (*cp != endc) {
        Parse_Error (PARSE_FATAL,
-                    "Unclosed %cinclude filename. '%c' expected",
-                    SPECIAL_CHAR, endc);
+                    "Unclosed .include filename. '%c' expected", endc);
        return;
     }
     *cp = '\0';
        return;
     }
     *cp = '\0';
@@ -1783,7 +1782,7 @@ ParseReadLine ()
     while(1) {
        c = ParseReadc();
 
     while(1) {
        c = ParseReadc();
 
-       if ((c == '\t') || (c == SPECIAL_CHAR)) {
+       if ((c == '\t') || (c == '.')) {
            ignComment = ignDepOp = TRUE;
            break;
        } else if (c == '\n') {
            ignComment = ignDepOp = TRUE;
            break;
        } else if (c == '\n') {
@@ -1920,7 +1919,7 @@ test_char:
        line = (char *)Buf_GetAll (buf, &lineLength);
        Buf_Destroy (buf, FALSE);
        
        line = (char *)Buf_GetAll (buf, &lineLength);
        Buf_Destroy (buf, FALSE);
        
-       if (line[0] == SPECIAL_CHAR) {
+       if (line[0] == '.') {
            /*
             * The line might be a conditional. Ask the conditional module
             * about it and act accordingly
            /*
             * The line might be a conditional. Ask the conditional module
             * about it and act accordingly
@@ -1937,7 +1936,7 @@ test_char:
                     * Skip lines until get to one that begins with a
                     * special char.
                     */
                     * Skip lines until get to one that begins with a
                     * special char.
                     */
-                   while ((c != SPECIAL_CHAR) && (c != EOF)) {
+                   while ((c != '.') && (c != EOF)) {
                        while (((c != '\n') || (lastc == '\\')) &&
                               (c != EOF))
                        {
                        while (((c != '\n') || (lastc == '\\')) &&
                               (c != EOF))
                        {
@@ -2048,7 +2047,7 @@ Parse_File(name, stream)
 
     do {
        while (line = ParseReadLine ()) {
 
     do {
        while (line = ParseReadLine ()) {
-           if (*line == SPECIAL_CHAR) {
+           if (*line == '.') {
                /*
                 * Lines that begin with the special character are either
                 * include or undef directives.
                /*
                 * Lines that begin with the special character are either
                 * include or undef directives.
@@ -2076,10 +2075,7 @@ Parse_File(name, stream)
                }
            }
            if (*line == '#') {
                }
            }
            if (*line == '#') {
-               /*
-                * If we're this far, the line must be a comment, even if
-                * SPECIAL_CHAR is '#'
-                */
+               /* If we're this far, the line must be a comment. */
                goto nextLine;
            }
            
                goto nextLine;
            }