mirror of
https://github.com/cc65/cc65.git
synced 2025-01-15 22:30:04 +00:00
Reversed the last change because it did not work
git-svn-id: svn://svn.cc65.org/cc65/trunk@1566 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4f9f06c20a
commit
08b095c604
@ -360,6 +360,21 @@ static SymEntry* SymFindAny (SymTable* Tab, const char* Name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static SymEntry* SymRefInternal (SymTable* Table, const char* Name)
|
||||||
|
/* Search for the symbol in the given table and return it */
|
||||||
|
{
|
||||||
|
/* Try to find the symbol, create a new one if the symbol does not exist */
|
||||||
|
SymEntry* S = SymFind (Table, Name, SF_ALLOC_NEW);
|
||||||
|
|
||||||
|
/* Mark the symbol as referenced */
|
||||||
|
S->Flags |= SF_REFERENCED;
|
||||||
|
|
||||||
|
/* Return it */
|
||||||
|
return S;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SymEnterLevel (void)
|
void SymEnterLevel (void)
|
||||||
/* Enter a new lexical level */
|
/* Enter a new lexical level */
|
||||||
{
|
{
|
||||||
@ -439,19 +454,8 @@ void SymDef (const char* Name, ExprNode* Expr, int ZP, int Label)
|
|||||||
SymEntry* SymRef (const char* Name)
|
SymEntry* SymRef (const char* Name)
|
||||||
/* Search for the symbol and return it */
|
/* Search for the symbol and return it */
|
||||||
{
|
{
|
||||||
/* Try to find the symbol in any visible table */
|
/* Reference the symbol in the current table */
|
||||||
SymEntry* S = SymFindAny (SymTab, Name);
|
return SymRefInternal (SymTab, Name);
|
||||||
|
|
||||||
/* If we could not find the symbol, create it in the local symtab */
|
|
||||||
if (S == 0) {
|
|
||||||
S = SymFind (SymTab, Name, SF_ALLOC_NEW);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mark the symbol as referenced */
|
|
||||||
S->Flags |= SF_REFERENCED;
|
|
||||||
|
|
||||||
/* Return it */
|
|
||||||
return S;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -459,14 +463,8 @@ SymEntry* SymRef (const char* Name)
|
|||||||
SymEntry* SymRefGlobal (const char* Name)
|
SymEntry* SymRefGlobal (const char* Name)
|
||||||
/* Search for the symbol in the global namespace and return it */
|
/* Search for the symbol in the global namespace and return it */
|
||||||
{
|
{
|
||||||
/* Try to find the symbol, create a new one if the symbol does not exist */
|
/* Reference the symbol in the current table */
|
||||||
SymEntry* S = SymFind (RootTab, Name, SF_ALLOC_NEW);
|
return SymRefInternal (RootTab, Name);
|
||||||
|
|
||||||
/* Mark the symbol as referenced */
|
|
||||||
S->Flags |= SF_REFERENCED;
|
|
||||||
|
|
||||||
/* Return it */
|
|
||||||
return S;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user