mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 22:30:12 +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:
parent
9f7fc6f4c8
commit
5d4790a137
@ -60,6 +60,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
|
|||||||
"pc_assignment",
|
"pc_assignment",
|
||||||
"missing_char_term",
|
"missing_char_term",
|
||||||
"ubiquitous_idents",
|
"ubiquitous_idents",
|
||||||
|
"c_comments",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -113,6 +114,7 @@ feature_t SetFeature (const StrBuf* Key)
|
|||||||
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
|
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
|
||||||
case FEAT_MISSING_CHAR_TERM: MissingCharTerm = 1; break;
|
case FEAT_MISSING_CHAR_TERM: MissingCharTerm = 1; break;
|
||||||
case FEAT_UBIQUITOUS_IDENTS: UbiquitousIdents = 1; break;
|
case FEAT_UBIQUITOUS_IDENTS: UbiquitousIdents = 1; break;
|
||||||
|
case FEAT_C_COMMENTS: CComments = 1; break;
|
||||||
default: /* Keep gcc silent */ break;
|
default: /* Keep gcc silent */ break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ typedef enum {
|
|||||||
FEAT_PC_ASSIGNMENT,
|
FEAT_PC_ASSIGNMENT,
|
||||||
FEAT_MISSING_CHAR_TERM,
|
FEAT_MISSING_CHAR_TERM,
|
||||||
FEAT_UBIQUITOUS_IDENTS,
|
FEAT_UBIQUITOUS_IDENTS,
|
||||||
|
FEAT_C_COMMENTS,
|
||||||
|
|
||||||
/* Special value: Number of features available */
|
/* Special value: Number of features available */
|
||||||
FEAT_COUNT
|
FEAT_COUNT
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2007 Ullrich von Bassewitz */
|
/* (C) 1998-2008 Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@ -77,6 +77,7 @@ unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */
|
|||||||
unsigned char MissingCharTerm = 0; /* Allow lda #'a (no closing term) */
|
unsigned char MissingCharTerm = 0; /* Allow lda #'a (no closing term) */
|
||||||
unsigned char UbiquitousIdents = 0; /* Allow ubiquitous identifiers */
|
unsigned char UbiquitousIdents = 0; /* Allow ubiquitous identifiers */
|
||||||
unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
|
unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
|
||||||
|
unsigned char CComments = 0; /* Allow C like comments */
|
||||||
|
|
||||||
/* Misc stuff */
|
/* Misc stuff */
|
||||||
const char Copyright[] = "(C) Copyright 1998-2005 Ullrich von Bassewitz";
|
const char Copyright[] = "(C) Copyright 1998-2005 Ullrich von Bassewitz";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2007 Ullrich von Bassewitz */
|
/* (C) 1998-2008 Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* 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 MissingCharTerm; /* Allow lda #'a (no closing term) */
|
||||||
extern unsigned char UbiquitousIdents; /* Allow ubiquitous identifiers */
|
extern unsigned char UbiquitousIdents; /* Allow ubiquitous identifiers */
|
||||||
extern unsigned char OrgPerSeg; /* Make .org local to current seg */
|
extern unsigned char OrgPerSeg; /* Make .org local to current seg */
|
||||||
|
extern unsigned char CComments; /* Allow C like comments */
|
||||||
|
|
||||||
/* Misc stuff */
|
/* Misc stuff */
|
||||||
extern const char Copyright[]; /* Copyright string */
|
extern const char Copyright[]; /* Copyright string */
|
||||||
|
@ -1063,7 +1063,7 @@ CharAgain:
|
|||||||
NextChar ();
|
NextChar ();
|
||||||
if (C != '*') {
|
if (C != '*') {
|
||||||
Tok = TOK_DIV;
|
Tok = TOK_DIV;
|
||||||
} else {
|
} else if (CComments) {
|
||||||
/* Remember the position, then skip the '*' */
|
/* Remember the position, then skip the '*' */
|
||||||
FilePos Pos = CurPos;
|
FilePos Pos = CurPos;
|
||||||
NextChar ();
|
NextChar ();
|
||||||
@ -1071,7 +1071,7 @@ CharAgain:
|
|||||||
while (C != '*') {
|
while (C != '*') {
|
||||||
if (C == EOF) {
|
if (C == EOF) {
|
||||||
PError (&Pos, "Unterminated comment");
|
PError (&Pos, "Unterminated comment");
|
||||||
goto Again;
|
goto CharAgain;
|
||||||
}
|
}
|
||||||
NextChar ();
|
NextChar ();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user