[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: |
Fri, 25 May 2007 17:27:39 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 07/05/25 17:27:37
Index: src/macro.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/macro.c,v
retrieving revision 1.1.1.1.2.16
retrieving revision 1.1.1.1.2.17
diff -u -b -r1.1.1.1.2.16 -r1.1.1.1.2.17
--- src/macro.c 1 Nov 2006 22:29:08 -0000 1.1.1.1.2.16
+++ src/macro.c 25 May 2007 17:27:37 -0000 1.1.1.1.2.17
@@ -1,7 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006 Free Software
- Foundation, Inc.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006, 2007 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "m4.h"
static void expand_macro (symbol *);
-static void expand_token (struct obstack *, token_type, token_data *);
+static void expand_token (struct obstack *, token_type, token_data *, int);
/* Current recursion level in expand_macro (). */
int expansion_level = 0;
@@ -59,12 +59,13 @@
{
token_type t;
token_data td;
+ int line;
obstack_init (&argc_stack);
obstack_init (&argv_stack);
- while ((t = next_token (&td)) != TOKEN_EOF)
- expand_token ((struct obstack *) NULL, t, &td);
+ while ((t = next_token (&td, &line)) != TOKEN_EOF)
+ expand_token ((struct obstack *) NULL, t, &td, line);
obstack_free (&argc_stack, NULL);
obstack_free (&argv_stack, NULL);
@@ -79,7 +80,7 @@
`------------------------------------------------------------------------*/
static void
-expand_token (struct obstack *obs, token_type t, token_data *td)
+expand_token (struct obstack *obs, token_type t, token_data *td, int line)
{
symbol *sym;
@@ -94,7 +95,8 @@
case TOKEN_CLOSE:
case TOKEN_SIMPLE:
case TOKEN_STRING:
- shipout_text (obs, TOKEN_DATA_TEXT (td), strlen (TOKEN_DATA_TEXT (td)));
+ shipout_text (obs, TOKEN_DATA_TEXT (td), strlen (TOKEN_DATA_TEXT (td)),
+ line);
break;
case TOKEN_WORD:
@@ -106,10 +108,10 @@
{
#ifdef ENABLE_CHANGEWORD
shipout_text (obs, TOKEN_DATA_ORIG_TEXT (td),
- strlen (TOKEN_DATA_ORIG_TEXT (td)));
+ strlen (TOKEN_DATA_ORIG_TEXT (td)), line);
#else
shipout_text (obs, TOKEN_DATA_TEXT (td),
- strlen (TOKEN_DATA_TEXT (td)));
+ strlen (TOKEN_DATA_TEXT (td)), line);
#endif
}
else
@@ -149,7 +151,7 @@
/* Skip leading white space. */
do
{
- t = next_token (&td);
+ t = next_token (&td, NULL);
}
while (t == TOKEN_SIMPLE && isspace (to_uchar (*TOKEN_DATA_TEXT (&td))));
@@ -184,7 +186,7 @@
paren_level++;
else if (*text == ')')
paren_level--;
- expand_token (obs, t, &td);
+ expand_token (obs, t, &td, line);
break;
case TOKEN_EOF:
@@ -196,7 +198,7 @@
case TOKEN_WORD:
case TOKEN_STRING:
- expand_token (obs, t, &td);
+ expand_token (obs, t, &td, line);
break;
case TOKEN_MACDEF:
@@ -213,7 +215,7 @@
abort ();
}
- t = next_token (&td);
+ t = next_token (&td, NULL);
}
}
@@ -239,7 +241,7 @@
if (peek_token () == TOKEN_OPEN)
{
- next_token (&td); /* gobble parenthesis */
+ next_token (&td, NULL); /* gobble parenthesis */
do
{
more_args = expand_argument (arguments, &td);
- Changes to m4/src/Attic/macro.c,v [branch-1_4],
Eric Blake <=