Release 4.1
[unix-history] / usr / src / usr.bin / tn3270 / tools / mkmake.y
index 086bf5c..67f7b81 100644 (file)
@@ -1,4 +1,24 @@
 %{
 %{
+
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)mkmake.y    4.1 (Berkeley) %G%
+ */
+
 typedef struct string {
     int
        hashval,
 typedef struct string {
     int
        hashval,
@@ -127,7 +147,7 @@ action:     white_space command_list NL
 for_statement: maybe_at_minus FOR white_space token
                in tokens semi_colon
     {
 for_statement: maybe_at_minus FOR white_space token
                in tokens semi_colon
     {
-       $$ = for_statement($1, $4, expand_variables($6, 0));
+       $$ = for_statement($1, $4, ws_merge(expand_variables($6, 0)));
     }
     ;
 
     }
     ;
 
@@ -667,14 +687,14 @@ int       free;
        char *string = token->string->string;
        same_t *tmp = same_unlink(token);
 
        char *string = token->string->string;
        same_t *tmp = same_unlink(token);
 
-       if ((string[0] == '$') && (string[1] == '{')) {/* '}' Expand time */
+       if ((string[0] == '$') && (string[1] == '{')) { /* Expand time */
            int len = strlen(string);
 
            string[len-1] = 0;
            head = same_cat(head, expand_variables(
                        value_of(same_item(string_lookup(string+2))), 1));
            string[len-1] = '}';
            int len = strlen(string);
 
            string[len-1] = 0;
            head = same_cat(head, expand_variables(
                        value_of(same_item(string_lookup(string+2))), 1));
            string[len-1] = '}';
-       } else if (!isspace(string[0])) {
+       } else {
            head = same_cat(head, token);
        }
        token = tmp;
            head = same_cat(head, token);
        }
        token = tmp;
@@ -935,7 +955,12 @@ yylex()
            Return(c,c);
        case '\'':
        case '"':
            Return(c,c);
        case '\'':
        case '"':
-           {
+           if (bufptr != buffer) {
+               if (bufptr[-1] == '\\') {
+                   bufptr[-1] = c;
+               }
+               break;
+           } else {
                int newc;
 
                ret_token(c);
                int newc;
 
                ret_token(c);
@@ -975,6 +1000,10 @@ yylex()
     Return(EOF, 0);
 }
 
     Return(EOF, 0);
 }
 
+#ifndef lint
+static char sccsid[] = "@(#)mkmake.y   4.1 (Berkeley) %G%";
+#endif /* not lint */
+
 main()
 {
 #define        YYDEBUG
 main()
 {
 #define        YYDEBUG