mirror of
https://github.com/cc65/cc65.git
synced 2024-11-19 21:32:19 +00:00
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:
parent
a62958764d
commit
b4214634b2
@ -629,10 +629,27 @@ static void FuncString (void)
|
||||
ConsumeLParen ();
|
||||
|
||||
/* 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 */
|
||||
SB_Copy (&Buf, &CurTok.SVal);
|
||||
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 {
|
||||
/* Numeric expression */
|
||||
long Val = ConstExpression ();
|
||||
|
Loading…
Reference in New Issue
Block a user