Modified to output a little less white space
This commit is contained in:
parent
2838d446ef
commit
659d310e37
1 changed files with 11 additions and 5 deletions
|
@ -99,19 +99,20 @@ do_pragma()
|
||||||
LineNumber++;
|
LineNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char Xbuf[256];
|
||||||
|
|
||||||
preprocess(fn)
|
preprocess(fn)
|
||||||
char *fn;
|
char *fn;
|
||||||
{
|
{
|
||||||
register int c;
|
register int c;
|
||||||
register char *op = _obuf;
|
register char *op = _obuf;
|
||||||
register char *ob = &_obuf[OBUFSIZE];
|
register char *ob = &_obuf[OBUFSIZE];
|
||||||
char Xbuf[256];
|
|
||||||
int lineno = 0;
|
int lineno = 0;
|
||||||
int startline;
|
int startline;
|
||||||
|
|
||||||
#define flush(X) (sys_write(STDOUT,_obuf,X))
|
#define flush(X) (sys_write(STDOUT,_obuf,X))
|
||||||
#define echo(ch) if (op == ob) { Xflush(); op = _obuf; } *op++ = (ch);
|
#define echo(ch) if (op == ob) { Xflush(); op = _obuf; } *op++ = (ch);
|
||||||
#define newline() echo('\n')
|
#define newline() op--; while (op >= _obuf && (*op == ' ' || *op == '\t')) op--; op++; echo('\n')
|
||||||
|
|
||||||
if (!options['P']) {
|
if (!options['P']) {
|
||||||
/* Generate a line directive communicating the
|
/* Generate a line directive communicating the
|
||||||
|
@ -133,11 +134,16 @@ preprocess(fn)
|
||||||
lineno = LineNumber; \
|
lineno = LineNumber; \
|
||||||
if (! options['P']) { \
|
if (! options['P']) { \
|
||||||
register char *p = Xbuf; \
|
register char *p = Xbuf; \
|
||||||
\
|
sprint(Xbuf, "%s %d \"%s\"\n", \
|
||||||
sprint(p, "\n%s %d \"%s\"\n", \
|
|
||||||
LINE_PREFIX, \
|
LINE_PREFIX, \
|
||||||
LineNumber, \
|
LineNumber, \
|
||||||
FileName); \
|
FileName); \
|
||||||
|
op--; \
|
||||||
|
while (op >= _obuf \
|
||||||
|
&& (class(*op) == STSKIP \
|
||||||
|
|| *op == '\n')) op--; \
|
||||||
|
op++; \
|
||||||
|
newline(); \
|
||||||
while (*p) { \
|
while (*p) { \
|
||||||
echo(*p++); \
|
echo(*p++); \
|
||||||
} \
|
} \
|
||||||
|
@ -235,7 +241,7 @@ preprocess(fn)
|
||||||
/* switch on character */
|
/* switch on character */
|
||||||
switch(class(c)) {
|
switch(class(c)) {
|
||||||
case STNL:
|
case STNL:
|
||||||
echo(c);
|
newline();
|
||||||
break;
|
break;
|
||||||
case STSTR:
|
case STSTR:
|
||||||
case STCHAR:
|
case STCHAR:
|
||||||
|
|
Loading…
Reference in a new issue