[Synopsis-cvs] CVS: Synopsis/Synopsis/Parser/C++/ucpp assert.c,1.4 cpp.c,1.8 macro.c,1.9
Stefan Seefeld stefan at users.sourceforge.netFri Aug 23 13:16:03 UTC 2002
- Previous message: [Synopsis-cvs] CVS: Synopsis/Synopsis/Parser/C++/syn Makefile,1.45
- Next message: [Synopsis-cvs] CVS: Synopsis setup.py,1.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /cvsroot/synopsis/Synopsis/Synopsis/Parser/C++/ucpp
In directory usw-pr-cvs1:/tmp/cvs-serv29493/Synopsis/Parser/C++/ucpp
Modified Files:
assert.c cpp.c macro.c
Log Message:
change file name to avoid name clash with distutils
Index: cpp.c
===================================================================
RCS file: /cvsroot/synopsis/Synopsis/Synopsis/Parser/C++/ucpp/cpp.c,v
retrieving revision 1.4
retrieving revision 1.8
diff -C2 -d -r1.4 -r1.8
*** cpp.c 22 Feb 2001 03:37:51 -0000 1.4
--- cpp.c 23 Aug 2002 20:15:39 -0000 1.8
***************
*** 53,57 ****
#include "ucppi.h"
#include "mem.h"
! #include "hash.h"
#ifdef UCPP_MMAP
#include <unistd.h>
--- 53,57 ----
#include "ucppi.h"
#include "mem.h"
! #include "hashtable.h"
#ifdef UCPP_MMAP
#include <unistd.h>
***************
*** 82,85 ****
--- 82,89 ----
static int current_incdir = -1;
+ #ifdef SYNOPSIS
+ void synopsis_macro_hook(const char* name, int line, int start, int end, int diff);
+ #endif
+
#ifndef NO_UCPP_ERROR_FUNCTIONS
/*
***************
*** 354,357 ****
--- 358,365 ----
ls->macro_count = 0;
#endif
+ #ifdef SYNOPSIS
+ ls->input_pos = 0;
+ ls->output_pos = 0;
+ #endif
}
***************
*** 1791,1794 ****
--- 1799,1809 ----
if ((m = get_macro(ls->ctok->name)) != 0) {
int x;
+ #ifdef SYNOPSIS
+ int o_pos, o_pos2, o_diff, o_line;
+ int i_pos, i_pos2, i_diff, i_line;
+ i_pos = ls->ctok->pos;
+ i_line = ls->line;
+ o_pos = ls->output_pos;
+ o_line = ls->oline;
x = substitute_macro(ls, m, 0, 1, 0,
***************
*** 1796,1799 ****
--- 1811,1830 ----
if (!(ls->flags & LEXER))
garbage_collect(ls->gf);
+ o_pos2 = ls->output_pos;
+ o_diff = o_pos2 - o_pos;
+ i_pos2 = ls->input_pos + (ls->discard ? 1 : 0);
+ i_diff = i_pos2 - i_pos;
+ if (ls_depth == 0) {
+ /*printf("MACRO: INPUT(line %d: %d -> %d = +- %d) OUTPUT(line %d: %d -> %d = +- %d)\n",
+ i_line, i_pos, i_pos2, i_diff,
+ o_line, o_pos, o_pos2, o_diff);*/
+ synopsis_macro_hook(m->name, i_line, o_pos, o_pos2, i_diff - o_diff);
+ }
+ #else
+ x = substitute_macro(ls, m, 0, 1, 0,
+ ls->ctok->line);
+ if (!(ls->flags & LEXER))
+ garbage_collect(ls->gf);
+ #endif
return r ? r : x;
}
***** Bogus filespec: macro.c,1.9
- Previous message: [Synopsis-cvs] CVS: Synopsis/Synopsis/Parser/C++/syn Makefile,1.45
- Next message: [Synopsis-cvs] CVS: Synopsis setup.py,1.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-changes mailing list