enum make_word_type
{
w_bogus, w_eol, w_static, w_variable, w_colon, w_dcolon, w_semicolon,
- w_varassign, w_ampcolon, w_ampdcolon
+ w_ampcolon, w_ampdcolon
};
}
\f
/* Parse the next "makefile word" from the input buffer, and return info
- about it.
+ about it. This function won't be called in any context where we might need
+ to parse a variable assignment so we don't need to check that.
A "makefile word" is one of:
w_ampcolon An ampersand-colon (&:) token
w_ampdcolon An ampersand-double-colon (&::) token
w_semicolon A semicolon
- w_varassign A variable assignment operator (=, :=, ::=, +=, ?=, or !=)
Note that this function is only used when reading certain parts of the
makefile. Don't use it where special rules hold sway (RHS of a variable,
- in a command list, etc.) */
+ in a recipe, etc.) */
static enum make_word_type
get_next_mword (char *buffer, char **startp, size_t *length)
wtype = w_semicolon;
goto done;
- case '=':
- wtype = w_varassign;
- goto done;
-
case ':':
- if (*p == '=')
- {
- ++p;
- wtype = w_varassign; /* := */
- }
- else if (*p == ':')
+ wtype = w_colon;
+ if (*p == ':')
{
++p;
- if (p[1] == '=')
- {
- ++p;
- wtype = w_varassign; /* ::= */
- }
- else
- wtype = w_dcolon;
+ wtype = w_dcolon;
}
- else
- wtype = w_colon;
goto done;
case '&':
}
break;
- case '+':
- case '?':
- case '!':
- if (*p == '=')
- {
- ++p;
- wtype = w_varassign; /* += or ?= or != */
- goto done;
- }
- break;
-
default:
break;
}
- /* This is some non-operator word. A word consists of the longest
- string of characters that doesn't contain whitespace, one of [:=#],
- or [?+!]=, or &:. */
+ /* This is some non-operator word. A word consists of the longest string of
+ characters that doesn't contain whitespace, one of [:#], or &:. */
/* We start out assuming a static word; if we see a variable we'll
adjust our assumptions then. */
switch (c)
{
- case '=':
- goto done_word;
-
case ':':
#ifdef HAVE_DOS_PATHS
/* A word CAN include a colon in its drive spec. The drive
p = skip_reference (p-1);
break;
- case '?':
- case '+':
- if (*p == '=')
- goto done_word;
- break;
-
case '\\':
switch (*p)
{
*startp = beg;
if (length)
*length = p - beg;
+
return wtype;
}
\f