-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch from Robert Dodier, thanks. (https://sourceforge.net/p/clisp/mailman/message/37633493/)
- Loading branch information
Showing
2 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
diff --git a/utils/ccmp2c.c b/utils/ccmp2c.c | ||
index ac9a68978..ed0931166 100644 | ||
--- a/utils/ccmp2c.c | ||
+++ b/utils/ccmp2c.c | ||
@@ -366,7 +366,7 @@ peek_char (BUFFILE_t *infile) | ||
/* These are the different token types. */ | ||
enum token_type_t | ||
{ | ||
- eof, /* End of file */ | ||
+ token_eof, /* End of file */ | ||
eofcomment, /* End of file inside comment */ | ||
eol, /* End of line */ | ||
ident, /* Identifier */ | ||
@@ -447,7 +447,7 @@ nexttoken (BUFFILE_t *infile, tokens_t *tokens, | ||
switch (c) | ||
{ | ||
case EOF: /* EOF */ | ||
- token->type = eof; | ||
+ token->type = token_eof; | ||
goto done; | ||
case ' ': case '\v': case '\t': | ||
continue; | ||
@@ -526,7 +526,7 @@ nexttoken (BUFFILE_t *infile, tokens_t *tokens, | ||
{ | ||
for (;;) { | ||
token_t *subtoken = nexttoken (infile, tokens, FALSE, TRUE); | ||
- if (subtoken->type == eof | ||
+ if (subtoken->type == token_eof | ||
|| subtoken->type == eofcomment | ||
|| subtoken->type == eol) | ||
break; | ||
@@ -640,7 +640,7 @@ tokenify (unsigned char *line, | ||
token_t *next = | ||
nexttoken (&infile, tokens, *within_comment, within_prep_directive); | ||
|
||
- if (next->type == eof) | ||
+ if (next->type == token_eof) | ||
{ | ||
*within_comment = FALSE; | ||
break; | ||
diff --git a/utils/gctrigger.c b/utils/gctrigger.c | ||
index 99727a1df..d8a807efe 100644 | ||
--- a/utils/gctrigger.c | ||
+++ b/utils/gctrigger.c | ||
@@ -502,7 +502,7 @@ static int next_char (void) | ||
- operator/separator | ||
Generalized tokens can be expressions, with balanced parentheses. */ | ||
enum token_type { | ||
- eof, | ||
+ token_eof, | ||
eol, | ||
ident, | ||
number, | ||
@@ -605,7 +605,7 @@ static Token nexttoken (boolean within_prep_directive) | ||
{ int c = next_char(); | ||
switch (c) { | ||
case EOF: | ||
- token.type = eof; return token; | ||
+ token.type = token_eof; return token; | ||
case ' ': case '\v': case '\t': | ||
/* Ignore whitespace. */ | ||
goto restart; | ||
@@ -650,7 +650,7 @@ static Token nexttoken (boolean within_prep_directive) | ||
/* Preprocessor directive. Read until end of line or EOF. */ | ||
while (1) { | ||
Token subtoken = nexttoken(TRUE); | ||
- if (subtoken.type == eof || subtoken.type == eol) | ||
+ if (subtoken.type == token_eof || subtoken.type == eol) | ||
break; | ||
Token_delete(&subtoken); | ||
} | ||
@@ -773,7 +773,7 @@ static Token next_balanced_token (Token* start_token, uintL open_braces_start) | ||
while (1) { | ||
/* Here always open_braces.count >= open_braces_start . */ | ||
switch (token.type) { | ||
- case eof: | ||
+ case token_eof: | ||
if (open_braces.count > open_braces_start) { | ||
if (open_braces.count <= MAXBRACES) | ||
fprintf(stderr,"unclosed '%c' in line %lu\n", | ||
@@ -854,7 +854,7 @@ static void convert (void) | ||
VectorToken_init(¶meter_declaration); | ||
while (1) { | ||
token = next_balanced_token(NULL,open_braces.count); | ||
- if (token.type == eof) | ||
+ if (token.type == token_eof) | ||
break; | ||
if (token.type == sep && (token.ch == ',' || token.ch == ')')) | ||
break; | ||
@@ -877,14 +877,14 @@ static void convert (void) | ||
} | ||
} | ||
VectorToken_delete(¶meter_declaration); | ||
- if (token.type == eof) | ||
+ if (token.type == token_eof) | ||
break; | ||
if (token.ch == ')') { | ||
handle_closing_token(&token); | ||
break; | ||
} | ||
} | ||
- if (token.type != eof) { | ||
+ if (token.type != token_eof) { | ||
token = next_token(); | ||
if (token.type == sep && token.ch == '{') { | ||
/* Here's the point where we insert the GCTRIGGER statement. */ | ||
@@ -921,7 +921,7 @@ static void convert (void) | ||
/* Continue the loop with the new token (as it might be a semicolon). */ | ||
goto restart; | ||
} | ||
- if (token.type == eof) | ||
+ if (token.type == token_eof) | ||
break; | ||
Token_delete(&token); | ||
} | ||
diff --git a/utils/varbrace.c b/utils/varbrace.c | ||
index cf071b9d6..c5e855766 100644 | ||
--- a/utils/varbrace.c | ||
+++ b/utils/varbrace.c | ||
@@ -1152,7 +1152,7 @@ static inline void line_repeat_endif () | ||
} | ||
|
||
|
||
-enum token_type { eof, ident, number, charconst, stringconst, sep, expr }; | ||
+enum token_type { token_eof, ident, number, charconst, stringconst, sep, expr }; | ||
typedef struct { | ||
enum token_type type; | ||
/* if buffered: */ | ||
@@ -1174,7 +1174,7 @@ static Token next_token (void) | ||
switch (c) { | ||
case EOF: | ||
/* EOF */ | ||
- token.type = eof; | ||
+ token.type = token_eof; | ||
goto done; | ||
case ' ': case '\v': case '\t': case '\n': | ||
/* whitespace, ignore */ | ||
@@ -1436,7 +1436,7 @@ static void convert (FILE* infp, FILE* outfp, const char* infilename) | ||
while (1) { | ||
Token token = next_token(); | ||
switch (token.type) { | ||
- case eof: | ||
+ case token_eof: | ||
if (open_braces.count > 0) { | ||
if (open_braces.count <= MAXBRACES) { | ||
fprintf(stderr,"Unclosed '%c' in line %lu\n", |