Permit the .string builtin function to work with scoped identifiers.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5786 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -629,10 +629,27 @@ static void FuncString (void)
|
|||||||
ConsumeLParen ();
|
ConsumeLParen ();
|
||||||
|
|
||||||
/* Accept identifiers or numeric expressions */
|
/* Accept identifiers or numeric expressions */
|
||||||
if (CurTok.Tok == TOK_IDENT || CurTok.Tok == TOK_LOCAL_IDENT) {
|
if (CurTok.Tok == TOK_LOCAL_IDENT) {
|
||||||
/* Save the identifier, then skip it */
|
/* Save the identifier, then skip it */
|
||||||
SB_Copy (&Buf, &CurTok.SVal);
|
SB_Copy (&Buf, &CurTok.SVal);
|
||||||
NextTok ();
|
NextTok ();
|
||||||
|
} else if (CurTok.Tok == TOK_NAMESPACE || CurTok.Tok == TOK_IDENT) {
|
||||||
|
|
||||||
|
/* Parse a fully qualified symbol name. We cannot use
|
||||||
|
* ParseScopedSymName here since the name may be invalid.
|
||||||
|
*/
|
||||||
|
int NameSpace;
|
||||||
|
do {
|
||||||
|
NameSpace = (CurTok.Tok == TOK_NAMESPACE);
|
||||||
|
if (NameSpace) {
|
||||||
|
SB_AppendStr (&Buf, "::");
|
||||||
|
} else {
|
||||||
|
SB_Append (&Buf, &CurTok.SVal);
|
||||||
|
}
|
||||||
|
NextTok ();
|
||||||
|
} while ((NameSpace != 0 && CurTok.Tok == TOK_IDENT) ||
|
||||||
|
(NameSpace == 0 && CurTok.Tok == TOK_NAMESPACE));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Numeric expression */
|
/* Numeric expression */
|
||||||
long Val = ConstExpression ();
|
long Val = ConstExpression ();
|
||||||
|
|||||||
Reference in New Issue
Block a user