mirror of
https://github.com/cc65/cc65.git
synced 2024-11-19 06:31:31 +00:00
Added new emulation feature: loose_char_term
git-svn-id: svn://svn.cc65.org/cc65/trunk@316 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
a41de0ea3f
commit
d27cd62465
@ -609,8 +609,13 @@ static ExprNode* Factor (void)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (LooseCharTerm && Tok == TOK_STRCON && strlen(SVal) == 1) {
|
||||
/* A character constant */
|
||||
N = LiteralExpr (TgtTranslateChar (SVal[0]));
|
||||
} else {
|
||||
N = LiteralExpr (0); /* Dummy */
|
||||
Error (ERR_SYNTAX);
|
||||
}
|
||||
NextTok ();
|
||||
break;
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
|
||||
"dollar_is_pc",
|
||||
"labels_without_colons",
|
||||
"loose_string_term",
|
||||
"loose_char_term",
|
||||
"at_in_identifiers",
|
||||
"dollar_in_identifiers",
|
||||
"pc_assignment",
|
||||
@ -100,6 +101,7 @@ feature_t SetFeature (const char* Key)
|
||||
case FEAT_DOLLAR_IS_PC: DollarIsPC = 1; break;
|
||||
case FEAT_LABELS_WITHOUT_COLONS: NoColonLabels = 1; break;
|
||||
case FEAT_LOOSE_STRING_TERM: LooseStringTerm= 1; break;
|
||||
case FEAT_LOOSE_CHAR_TERM: LooseCharTerm = 1; break;
|
||||
case FEAT_AT_IN_IDENTIFIERS: AtInIdents = 1; break;
|
||||
case FEAT_DOLLAR_IN_IDENTIFIERS: DollarInIdents = 1; break;
|
||||
case FEAT_PC_ASSIGNMENT: PCAssignment = 1; break;
|
||||
|
@ -49,6 +49,7 @@ typedef enum {
|
||||
FEAT_DOLLAR_IS_PC,
|
||||
FEAT_LABELS_WITHOUT_COLONS,
|
||||
FEAT_LOOSE_STRING_TERM,
|
||||
FEAT_LOOSE_CHAR_TERM,
|
||||
FEAT_AT_IN_IDENTIFIERS,
|
||||
FEAT_DOLLAR_IN_IDENTIFIERS,
|
||||
FEAT_PC_ASSIGNMENT,
|
||||
|
@ -66,6 +66,7 @@ unsigned char LineCont = 0; /* Allow line continuation */
|
||||
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 */
|
||||
unsigned char LooseCharTerm = 0; /* Allow " for char constants */
|
||||
unsigned char AtInIdents = 0; /* Allow '@' in identifiers */
|
||||
unsigned char DollarInIdents = 0; /* Allow '$' in identifiers */
|
||||
unsigned char PCAssignment = 0; /* Allow "* = $XXX" or "$ = $XXX" */
|
||||
|
@ -67,6 +67,7 @@ extern unsigned char LineCont; /* Allow line continuation */
|
||||
extern unsigned char DollarIsPC; /* Allow the $ symbol as current PC */
|
||||
extern unsigned char NoColonLabels; /* Allow labels without a colon */
|
||||
extern unsigned char LooseStringTerm;/* Allow ' as string terminator */
|
||||
extern unsigned char LooseCharTerm; /* Allow " for char constants */
|
||||
extern unsigned char AtInIdents; /* Allow '@' in identifiers */
|
||||
extern unsigned char DollarInIdents; /* Allow '$' in identifiers */
|
||||
extern unsigned char PCAssignment; /* Allow "* = $XXX" or "$ = $XXX" */
|
||||
|
@ -128,6 +128,7 @@ struct DotKeyword {
|
||||
{ "BITXOR", TOK_XOR },
|
||||
{ "BLANK", TOK_BLANK },
|
||||
{ "BSS", TOK_BSS },
|
||||
{ "BYT", TOK_BYTE },
|
||||
{ "BYTE", TOK_BYTE },
|
||||
{ "CASE", TOK_CASE },
|
||||
{ "CODE", TOK_CODE },
|
||||
|
Loading…
Reference in New Issue
Block a user