mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Identifiers starting with a dot could not be used as namens for .define
style macros, even with --leading_dots_in_identifiers. This was also true for symbols with one character names and without a leading dot. git-svn-id: svn://svn.cc65.org/cc65/trunk@2882 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4d80ff9214
commit
96f96a5bde
@ -747,15 +747,25 @@ Again:
|
|||||||
/* Dot keyword, search for it */
|
/* Dot keyword, search for it */
|
||||||
Tok = FindDotKeyword ();
|
Tok = FindDotKeyword ();
|
||||||
if (Tok == TOK_NONE) {
|
if (Tok == TOK_NONE) {
|
||||||
|
|
||||||
/* Not found */
|
/* Not found */
|
||||||
if (LeadingDotInIdents) {
|
if (!LeadingDotInIdents) {
|
||||||
/* An identifier with a dot */
|
|
||||||
Tok = TOK_IDENT;
|
|
||||||
} else {
|
|
||||||
/* Invalid pseudo instruction */
|
/* Invalid pseudo instruction */
|
||||||
Error ("`%s' is not a recognized control command", SVal);
|
Error ("`%s' is not a recognized control command", SVal);
|
||||||
goto Again;
|
goto Again;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* An identifier with a dot. Check if it's a define style
|
||||||
|
* macro.
|
||||||
|
*/
|
||||||
|
if (IsDefine (SVal)) {
|
||||||
|
/* This is a define style macro - expand it */
|
||||||
|
MacExpandStart ();
|
||||||
|
goto Restart;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Just an identifier with a dot */
|
||||||
|
Tok = TOK_IDENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -786,16 +796,18 @@ Again:
|
|||||||
/* Read the identifier */
|
/* Read the identifier */
|
||||||
ReadIdent (0);
|
ReadIdent (0);
|
||||||
|
|
||||||
/* Check for special names */
|
/* Check for special names. Bail out if we have identified the type of
|
||||||
|
* the token. Go on if the token is an identifier.
|
||||||
|
*/
|
||||||
if (SVal[1] == '\0') {
|
if (SVal[1] == '\0') {
|
||||||
switch (toupper (SVal [0])) {
|
switch (toupper (SVal [0])) {
|
||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
if (C == ':') {
|
if (C == ':') {
|
||||||
NextChar ();
|
NextChar ();
|
||||||
Tok = TOK_OVERRIDE_ABS;
|
Tok = TOK_OVERRIDE_ABS;
|
||||||
} else {
|
} else {
|
||||||
Tok = TOK_A;
|
Tok = TOK_A;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -803,35 +815,32 @@ Again:
|
|||||||
if (C == ':') {
|
if (C == ':') {
|
||||||
NextChar ();
|
NextChar ();
|
||||||
Tok = TOK_OVERRIDE_FAR;
|
Tok = TOK_OVERRIDE_FAR;
|
||||||
} else {
|
return;
|
||||||
Tok = TOK_IDENT;
|
|
||||||
}
|
}
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
Tok = TOK_S;
|
Tok = TOK_S;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'X':
|
case 'X':
|
||||||
Tok = TOK_X;
|
Tok = TOK_X;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'Y':
|
case 'Y':
|
||||||
Tok = TOK_Y;
|
Tok = TOK_Y;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
if (C == ':') {
|
if (C == ':') {
|
||||||
NextChar ();
|
NextChar ();
|
||||||
Tok = TOK_OVERRIDE_ZP;
|
Tok = TOK_OVERRIDE_ZP;
|
||||||
} else {
|
return;
|
||||||
Tok = TOK_IDENT;
|
|
||||||
}
|
}
|
||||||
return;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Tok = TOK_IDENT;
|
break;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user