1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 03:29:39 +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:
cuz 2004-03-29 15:58:34 +00:00
parent a8ec7aafae
commit 5c63b08d26
6 changed files with 32 additions and 15 deletions

View File

@ -908,7 +908,7 @@ if you want to access the "other" symbol <tt/bar/, you would have to write:
.endscope .endscope
</verb></tscreen> </verb></tscreen>
<sect>Address sizes<label id="address-sizes"><p> <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 removing the lines with the assignments may also be an option when porting
code written for older assemblers). 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> </descrip>
It is also possible to specify features on the command line using the It is also possible to specify features on the command line using the

View File

@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2000-2002 Ullrich von Bassewitz */ /* (C) 2000-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */ /* Römerstraße 52 */
/* D-70597 Stuttgart */ /* D-70794 Filderstadt */
/* EMail: uz@musoftware.de */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@ -57,6 +57,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
"dollar_in_identifiers", "dollar_in_identifiers",
"leading_dot_in_identifiers", "leading_dot_in_identifiers",
"pc_assignment", "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_DOLLAR_IN_IDENTIFIERS: DollarInIdents = 1; break;
case FEAT_LEADING_DOT_IN_IDENTIFIERS: LeadingDotInIdents= 1; break; case FEAT_LEADING_DOT_IN_IDENTIFIERS: LeadingDotInIdents= 1; break;
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break; case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
case FEAT_MISSING_CHAR_TERM: MissingCharTerm = 1; break;
default: /* Keep gcc silent */ break; default: /* Keep gcc silent */ break;
} }

View File

@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2000-2002 Ullrich von Bassewitz */ /* (C) 2000-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */ /* Römerstraße 52 */
/* D-70597 Stuttgart */ /* D-70794 Filderstadt */
/* EMail: uz@musoftware.de */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@ -54,6 +54,7 @@ typedef enum {
FEAT_DOLLAR_IN_IDENTIFIERS, FEAT_DOLLAR_IN_IDENTIFIERS,
FEAT_LEADING_DOT_IN_IDENTIFIERS, FEAT_LEADING_DOT_IN_IDENTIFIERS,
FEAT_PC_ASSIGNMENT, FEAT_PC_ASSIGNMENT,
FEAT_MISSING_CHAR_TERM,
/* Special value: Number of features available */ /* Special value: Number of features available */
FEAT_COUNT FEAT_COUNT

View File

@ -74,6 +74,7 @@ unsigned char AtInIdents = 0; /* Allow '@' in identifiers */
unsigned char DollarInIdents = 0; /* Allow '$' in identifiers */ unsigned char DollarInIdents = 0; /* Allow '$' in identifiers */
unsigned char LeadingDotInIdents = 0; /* Allow '.' to start an identifier */ unsigned char LeadingDotInIdents = 0; /* Allow '.' to start an identifier */
unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */ unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */
unsigned char MissingCharTerm = 0; /* Allow lda #'a (no closing term) */
/* Misc stuff */ /* Misc stuff */
const char Copyright[] = "(C) Copyright 1998-2004 Ullrich von Bassewitz"; const char Copyright[] = "(C) Copyright 1998-2004 Ullrich von Bassewitz";

View File

@ -71,6 +71,7 @@ extern unsigned char AtInIdents; /* Allow '@' in identifiers */
extern unsigned char DollarInIdents; /* Allow '$' in identifiers */ extern unsigned char DollarInIdents; /* Allow '$' in identifiers */
extern unsigned char LeadingDotInIdents; /* Allow '.' to start an identifier */ extern unsigned char LeadingDotInIdents; /* Allow '.' to start an identifier */
extern unsigned char PCAssignment; /* Allow "* = $XXX" or "$ = $XXX" */ extern unsigned char PCAssignment; /* Allow "* = $XXX" or "$ = $XXX" */
extern unsigned char MissingCharTerm; /* Allow lda #'a (no closing term) */
/* Misc stuff */ /* Misc stuff */
extern const char Copyright[]; /* Copyright string */ extern const char Copyright[]; /* Copyright string */

View File

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998-2003 Ullrich von Bassewitz */ /* (C) 1998-2004 Ullrich von Bassewitz */
/* Römerstraße 52 */ /* Römerstraße 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -469,8 +469,8 @@ static void NextChar (void)
/* End of current line reached, read next line */ /* End of current line reached, read next line */
if (fgets (IFile->Line, sizeof (IFile->Line), IFile->F) == 0) { if (fgets (IFile->Line, sizeof (IFile->Line), IFile->F) == 0) {
/* End of file. Add an empty line to the listing. This is a /* 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); NewListingLine ("", IFile->Pos.Name, ICount);
C = EOF; C = EOF;
return; return;
@ -617,7 +617,7 @@ static unsigned ReadStringConst (int StringTerm)
/* Return the length of the string */ /* Return the length of the string */
return I; return I;
} }
@ -1043,7 +1043,7 @@ CharAgain:
} else { } else {
/* Always a character constant */ /* Always a character constant */
NextChar (); NextChar ();
if (C == '\n' || C == EOF) { if (C == EOF || IsControl (C)) {
Error ("Illegal character constant"); Error ("Illegal character constant");
goto CharAgain; goto CharAgain;
} }
@ -1051,7 +1051,9 @@ CharAgain:
Tok = TOK_CHARCON; Tok = TOK_CHARCON;
NextChar (); NextChar ();
if (C != '\'') { if (C != '\'') {
Error ("Illegal character constant"); if (!MissingCharTerm) {
Error ("Illegal character constant");
}
} else { } else {
NextChar (); NextChar ();
} }