mirror of
https://github.com/cc65/cc65.git
synced 2025-01-24 20:30:08 +00:00
New feature missing_char_term
git-svn-id: svn://svn.cc65.org/cc65/trunk@2964 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
a8ec7aafae
commit
5c63b08d26
@ -908,7 +908,7 @@ if you want to access the "other" symbol <tt/bar/, you would have to write:
|
||||
.endscope
|
||||
</verb></tscreen>
|
||||
|
||||
|
||||
|
||||
<sect>Address sizes<label id="address-sizes"><p>
|
||||
|
||||
|
||||
@ -2075,6 +2075,16 @@ Here's a list of all control commands and a description, what they do:
|
||||
removing the lines with the assignments may also be an option when porting
|
||||
code written for older assemblers).
|
||||
|
||||
<tag><tt>missing_char_term</tt></tag>
|
||||
|
||||
Accept single quoted character constants where the terminating quote is
|
||||
missing.
|
||||
<tscreen><verb>
|
||||
lda #'a
|
||||
</verb></tscreen>
|
||||
<bf/Note:/ This does not work in conjunction with <tt/.FEATURE
|
||||
loose_string_term/, since in this case the input would be ambigous.
|
||||
|
||||
</descrip>
|
||||
|
||||
It is also possible to specify features on the command line using the
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 2000-2003 Ullrich von Bassewitz */
|
||||
/* Römerstraße 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -57,6 +57,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
|
||||
"dollar_in_identifiers",
|
||||
"leading_dot_in_identifiers",
|
||||
"pc_assignment",
|
||||
"missing_char_term",
|
||||
};
|
||||
|
||||
|
||||
@ -107,6 +108,7 @@ feature_t SetFeature (const char* Key)
|
||||
case FEAT_DOLLAR_IN_IDENTIFIERS: DollarInIdents = 1; break;
|
||||
case FEAT_LEADING_DOT_IN_IDENTIFIERS: LeadingDotInIdents= 1; break;
|
||||
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
|
||||
case FEAT_MISSING_CHAR_TERM: MissingCharTerm = 1; break;
|
||||
default: /* Keep gcc silent */ break;
|
||||
}
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 2000-2003 Ullrich von Bassewitz */
|
||||
/* Römerstraße 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -54,6 +54,7 @@ typedef enum {
|
||||
FEAT_DOLLAR_IN_IDENTIFIERS,
|
||||
FEAT_LEADING_DOT_IN_IDENTIFIERS,
|
||||
FEAT_PC_ASSIGNMENT,
|
||||
FEAT_MISSING_CHAR_TERM,
|
||||
|
||||
/* Special value: Number of features available */
|
||||
FEAT_COUNT
|
||||
|
@ -74,6 +74,7 @@ unsigned char AtInIdents = 0; /* Allow '@' in identifiers */
|
||||
unsigned char DollarInIdents = 0; /* Allow '$' in identifiers */
|
||||
unsigned char LeadingDotInIdents = 0; /* Allow '.' to start an identifier */
|
||||
unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */
|
||||
unsigned char MissingCharTerm = 0; /* Allow lda #'a (no closing term) */
|
||||
|
||||
/* Misc stuff */
|
||||
const char Copyright[] = "(C) Copyright 1998-2004 Ullrich von Bassewitz";
|
||||
|
@ -71,6 +71,7 @@ extern unsigned char AtInIdents; /* Allow '@' in identifiers */
|
||||
extern unsigned char DollarInIdents; /* Allow '$' in identifiers */
|
||||
extern unsigned char LeadingDotInIdents; /* Allow '.' to start an identifier */
|
||||
extern unsigned char PCAssignment; /* Allow "* = $XXX" or "$ = $XXX" */
|
||||
extern unsigned char MissingCharTerm; /* Allow lda #'a (no closing term) */
|
||||
|
||||
/* Misc stuff */
|
||||
extern const char Copyright[]; /* Copyright string */
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* (C) 1998-2004 Ullrich von Bassewitz */
|
||||
/* Römerstraße 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -469,8 +469,8 @@ static void NextChar (void)
|
||||
/* End of current line reached, read next line */
|
||||
if (fgets (IFile->Line, sizeof (IFile->Line), IFile->F) == 0) {
|
||||
/* End of file. Add an empty line to the listing. This is a
|
||||
* small hack needed to keep the PC output in sync.
|
||||
*/
|
||||
* small hack needed to keep the PC output in sync.
|
||||
*/
|
||||
NewListingLine ("", IFile->Pos.Name, ICount);
|
||||
C = EOF;
|
||||
return;
|
||||
@ -617,7 +617,7 @@ static unsigned ReadStringConst (int StringTerm)
|
||||
|
||||
/* Return the length of the string */
|
||||
return I;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1043,7 +1043,7 @@ CharAgain:
|
||||
} else {
|
||||
/* Always a character constant */
|
||||
NextChar ();
|
||||
if (C == '\n' || C == EOF) {
|
||||
if (C == EOF || IsControl (C)) {
|
||||
Error ("Illegal character constant");
|
||||
goto CharAgain;
|
||||
}
|
||||
@ -1051,7 +1051,9 @@ CharAgain:
|
||||
Tok = TOK_CHARCON;
|
||||
NextChar ();
|
||||
if (C != '\'') {
|
||||
Error ("Illegal character constant");
|
||||
if (!MissingCharTerm) {
|
||||
Error ("Illegal character constant");
|
||||
}
|
||||
} else {
|
||||
NextChar ();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user