mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Deprecate IMPORT keyword
IMPORT is simply useless, any symbol that isn't found in the current file is automatically flagged as imported symbol. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -54,7 +54,6 @@ void sym_AddEqu(char *tzSym, SLONG value);
|
||||
void sym_AddSet(char *tzSym, SLONG value);
|
||||
void sym_Init(void);
|
||||
ULONG sym_GetConstantValue(char *s);
|
||||
void sym_Import(char *tzSym);
|
||||
ULONG sym_isConstant(char *s);
|
||||
struct sSymbol *sym_FindSymbol(char *tzName);
|
||||
void sym_Global(char *tzSym);
|
||||
|
||||
@@ -772,7 +772,13 @@ import_list : import_list_entry
|
||||
| import_list_entry ',' import_list
|
||||
;
|
||||
|
||||
import_list_entry : T_ID { sym_Import($1); }
|
||||
import_list_entry : T_ID {
|
||||
/* This is done automatically if
|
||||
* the label isn't found in the
|
||||
* list of defined symbols. */
|
||||
if( nPass==1 )
|
||||
warning("IMPORT is a deprecated keyword with no effect: %s", $1);
|
||||
}
|
||||
;
|
||||
|
||||
export : T_POP_EXPORT export_list
|
||||
|
||||
@@ -689,24 +689,6 @@ sym_Export(char *tzSym)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Import a symbol
|
||||
*/
|
||||
void
|
||||
sym_Import(char *tzSym)
|
||||
{
|
||||
if (nPass == 1) {
|
||||
/* only import symbols in pass 1 */
|
||||
struct sSymbol *nsym;
|
||||
|
||||
if (findsymbol(tzSym, NULL)) {
|
||||
yyerror("'%s' already defined", tzSym);
|
||||
}
|
||||
if ((nsym = createsymbol(tzSym)) != NULL)
|
||||
nsym->nType |= SYMF_IMPORT;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Globalize a symbol (export if defined, import if not)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user