1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +00:00

Enable use of new C like comments only if the new feature "c_comments" is

enabled.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3889 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2008-08-21 19:35:39 +00:00
parent 9f7fc6f4c8
commit 5d4790a137
5 changed files with 11 additions and 6 deletions

View File

@ -60,6 +60,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
"pc_assignment",
"missing_char_term",
"ubiquitous_idents",
"c_comments",
};
@ -113,6 +114,7 @@ feature_t SetFeature (const StrBuf* Key)
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
case FEAT_MISSING_CHAR_TERM: MissingCharTerm = 1; break;
case FEAT_UBIQUITOUS_IDENTS: UbiquitousIdents = 1; break;
case FEAT_C_COMMENTS: CComments = 1; break;
default: /* Keep gcc silent */ break;
}

View File

@ -62,6 +62,7 @@ typedef enum {
FEAT_PC_ASSIGNMENT,
FEAT_MISSING_CHAR_TERM,
FEAT_UBIQUITOUS_IDENTS,
FEAT_C_COMMENTS,
/* Special value: Number of features available */
FEAT_COUNT

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2007 Ullrich von Bassewitz */
/* (C) 1998-2008 Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@ -65,7 +65,7 @@ unsigned char DbgSyms = 0; /* Add debug symbols */
unsigned char Listing = 0; /* Create listing file */
unsigned char LineCont = 0; /* Allow line continuation */
/* Emulation features */
/* Emulation features */
unsigned char DollarIsPC = 0; /* Allow the $ symbol as current PC */
unsigned char NoColonLabels = 0; /* Allow labels without a colon */
unsigned char LooseStringTerm = 0; /* Allow ' as string terminator */
@ -77,6 +77,7 @@ unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */
unsigned char MissingCharTerm = 0; /* Allow lda #'a (no closing term) */
unsigned char UbiquitousIdents = 0; /* Allow ubiquitous identifiers */
unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
unsigned char CComments = 0; /* Allow C like comments */
/* Misc stuff */
const char Copyright[] = "(C) Copyright 1998-2005 Ullrich von Bassewitz";

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2007 Ullrich von Bassewitz */
/* (C) 1998-2008 Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@ -74,6 +74,7 @@ extern unsigned char PCAssignment; /* Allow "* = $XXX" or "$ = $XXX" */
extern unsigned char MissingCharTerm; /* Allow lda #'a (no closing term) */
extern unsigned char UbiquitousIdents; /* Allow ubiquitous identifiers */
extern unsigned char OrgPerSeg; /* Make .org local to current seg */
extern unsigned char CComments; /* Allow C like comments */
/* Misc stuff */
extern const char Copyright[]; /* Copyright string */

View File

@ -1063,7 +1063,7 @@ CharAgain:
NextChar ();
if (C != '*') {
Tok = TOK_DIV;
} else {
} else if (CComments) {
/* Remember the position, then skip the '*' */
FilePos Pos = CurPos;
NextChar ();
@ -1071,14 +1071,14 @@ CharAgain:
while (C != '*') {
if (C == EOF) {
PError (&Pos, "Unterminated comment");
goto Again;
goto CharAgain;
}
NextChar ();
}
NextChar ();
} while (C != '/');
NextChar ();
goto Again;
goto Again;
}
return;