break;
default:
- N = LiteralExpr (0); /* Dummy */
- Error (ERR_SYNTAX);
+ 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;
}
"dollar_is_pc",
"labels_without_colons",
"loose_string_term",
+ "loose_char_term",
"at_in_identifiers",
"dollar_in_identifiers",
"pc_assignment",
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;
default: /* Keep gcc silent */ break;
- }
+ }
/* Return the value found */
return Feature;
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,
-
+
/* Special value: Number of features available */
FEAT_COUNT
} feature_t;
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" */
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" */
{ "BITXOR", TOK_XOR },
{ "BLANK", TOK_BLANK },
{ "BSS", TOK_BSS },
+ { "BYT", TOK_BYTE },
{ "BYTE", TOK_BYTE },
{ "CASE", TOK_CASE },
{ "CODE", TOK_CODE },