[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/src/Attic/macro.c,v [branch-1_4]
From: |
Eric Blake |
Subject: |
Changes to m4/src/Attic/macro.c,v [branch-1_4] |
Date: |
Thu, 03 Aug 2006 13:31:43 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 06/08/03 13:31:40
Index: src/macro.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/macro.c,v
retrieving revision 1.1.1.1.2.8
retrieving revision 1.1.1.1.2.9
diff -u -b -r1.1.1.1.2.8 -r1.1.1.1.2.9
--- src/macro.c 1 Aug 2006 13:05:45 -0000 1.1.1.1.2.8
+++ src/macro.c 3 Aug 2006 13:31:40 -0000 1.1.1.1.2.9
@@ -66,6 +66,9 @@
case TOKEN_MACDEF:
break;
+ case TOKEN_OPEN:
+ case TOKEN_COMMA:
+ case TOKEN_CLOSE:
case TOKEN_SIMPLE:
case TOKEN_STRING:
shipout_text (obs, TOKEN_DATA_TEXT (td), strlen (TOKEN_DATA_TEXT (td)));
@@ -76,7 +79,7 @@
if (sym == NULL || SYMBOL_TYPE (sym) == TOKEN_VOID
|| (SYMBOL_TYPE (sym) == TOKEN_FUNC
&& SYMBOL_BLIND_NO_ARGS (sym)
- && peek_input () != '('))
+ && peek_token () != TOKEN_OPEN))
{
#ifdef ENABLE_CHANGEWORD
shipout_text (obs, TOKEN_DATA_ORIG_TEXT (td),
@@ -134,11 +137,10 @@
switch (t)
{ /* TOKSW */
- case TOKEN_SIMPLE:
- text = TOKEN_DATA_TEXT (&td);
- if ((*text == ',' || *text == ')') && paren_level == 0)
+ case TOKEN_COMMA:
+ case TOKEN_CLOSE:
+ if (paren_level == 0)
{
-
/* The argument MUST be finished, whether we want it or not. */
obstack_1grow (obs, '\0');
text = obstack_finish (obs);
@@ -148,8 +150,12 @@
TOKEN_DATA_TYPE (argp) = TOKEN_TEXT;
TOKEN_DATA_TEXT (argp) = text;
}
- return (boolean) (*TOKEN_DATA_TEXT (&td) == ',');
+ return (boolean) (t == TOKEN_COMMA);
}
+ /* fallthru */
+ case TOKEN_OPEN:
+ case TOKEN_SIMPLE:
+ text = TOKEN_DATA_TEXT (&td);
if (*text == '(')
paren_level++;
@@ -198,7 +204,6 @@
collect_arguments (symbol *sym, struct obstack *argptr,
struct obstack *arguments)
{
- int ch; /* lookahead for ( */
token_data td;
token_data *tdp;
boolean more_args;
@@ -209,8 +214,7 @@
tdp = (token_data *) obstack_copy (arguments, &td, sizeof (td));
obstack_grow (argptr, &tdp, sizeof (tdp));
- ch = peek_input ();
- if (ch == '(')
+ if (peek_token () == TOKEN_OPEN)
{
next_token (&td); /* gobble parenthesis */
do