harder to compare whitespacing
This commit is contained in:
parent
ccdab83c06
commit
3ddf4faed9
@ -679,24 +679,23 @@ if{wsnl}*\( { /* ignore 'if' */
|
|||||||
|
|
||||||
/* FIXME HBB 20001007: should call input() instead */
|
/* FIXME HBB 20001007: should call input() instead */
|
||||||
switch (input()) { /* tab and EOF just fall through */
|
switch (input()) { /* tab and EOF just fall through */
|
||||||
case ' ': /* breakpoint number line */
|
case ' ': /* breakpoint number line */
|
||||||
case '[':
|
case '[': {
|
||||||
for (i = 1; i < 8 && input() > LEXEOF; ++i)
|
for (i = 1; i < 8 && input() > LEXEOF; ++i) { ; }
|
||||||
;
|
} break;
|
||||||
break;
|
case '.': /* header line */
|
||||||
case '.': /* header line */
|
case '/':
|
||||||
case '/':
|
/* skip to the end of the line */
|
||||||
/* skip to the end of the line */
|
while ((c = input()) > LEXEOF) {
|
||||||
while ((c = input()) > LEXEOF) {
|
if (c == '\n') {
|
||||||
if (c == '\n') {
|
unput(c);
|
||||||
unput(c);
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case '\n': { /* empty line */
|
||||||
case '\n': /* empty line */
|
unput('\n');
|
||||||
unput('\n');
|
} break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eol:
|
eol:
|
||||||
@ -770,30 +769,31 @@ if{wsnl}*\( { /* ignore 'if' */
|
|||||||
}
|
}
|
||||||
|
|
||||||
"/*" yy_push_state(COMMENT);
|
"/*" yy_push_state(COMMENT);
|
||||||
|
|
||||||
<COMMENT>{
|
<COMMENT>{
|
||||||
[^*\n]* |
|
[^*\n]* |
|
||||||
"*"+[^*/\n]* ; /* do nothing */
|
"*"+[^*/\n]* ; /* do nothing */
|
||||||
[^*\n]*\n |
|
[^*\n]*\n |
|
||||||
"*"+[^*/\n]*\n {
|
"*"+[^*/\n]*\n {
|
||||||
if (ppdefine == false) {
|
if (ppdefine == false) {
|
||||||
goto eol;
|
goto eol;
|
||||||
} else {
|
} else {
|
||||||
++myylineno;
|
++myylineno;
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
"*"+"/" {
|
"*"+"/" {
|
||||||
/* replace the comment by a single blank */
|
/* replace the comment by a single blank */
|
||||||
unput(' ');
|
unput(' ');
|
||||||
yy_pop_state();
|
yy_pop_state();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"//".*\n? {
|
"//".*\n? {
|
||||||
/* C++-style one-line comment */
|
/* C++-style one-line comment */
|
||||||
goto eol;
|
goto eol;
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
{number} | /* number */
|
{number} | /* number */
|
||||||
<SDL>STATE[ \t]+ | /* ... and other syntax error catchers... */
|
<SDL>STATE[ \t]+ | /* ... and other syntax error catchers... */
|
||||||
@ -853,29 +853,29 @@ initscanner(char *srcfile)
|
|||||||
/* if this is not a C file */
|
/* if this is not a C file */
|
||||||
if ((s = strrchr(srcfile, '.')) != NULL) {
|
if ((s = strrchr(srcfile, '.')) != NULL) {
|
||||||
switch (*++s) { /* this switch saves time on C files */
|
switch (*++s) { /* this switch saves time on C files */
|
||||||
case 'b':
|
case 'b': {
|
||||||
if (strcmp(s, "bp") == 0) { /* breakpoint listing */
|
if (strcmp(s, "bp") == 0) { /* breakpoint listing */
|
||||||
bplisting = true;
|
bplisting = true;
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
case 'l':
|
case 'l': {
|
||||||
if (strcmp(s, "l") == 0) { /* lex */
|
if (strcmp(s, "l") == 0) { /* lex */
|
||||||
lex = true;
|
lex = true;
|
||||||
global = false;
|
global = false;
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
case 's':
|
case 's': {
|
||||||
if (strcmp(s, "sd") == 0) { /* sdl */
|
if (strcmp(s, "sd") == 0) { /* sdl */
|
||||||
sdl = true;
|
sdl = true;
|
||||||
BEGIN(SDL);
|
BEGIN(SDL);
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
case 'y':
|
case 'y': {
|
||||||
if (strcmp(s, "y") == 0) { /* yacc */
|
if (strcmp(s, "y") == 0) { /* yacc */
|
||||||
global = false;
|
global = false;
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user