Remove deprecated symbols

Fixes #896
This commit is contained in:
ISSOtm
2022-05-21 21:20:44 +02:00
parent 80df6640e3
commit b037d54f64
8 changed files with 3 additions and 78 deletions

View File

@@ -11,7 +11,6 @@
#include <stdint.h>
int32_t fix_Callback_PI(void);
void fix_Print(int32_t i);
int32_t fix_Sin(int32_t i);
int32_t fix_Cos(int32_t i);

View File

@@ -30,16 +30,6 @@
#define M_PI 3.14159265358979323846
#endif
/*
* Return the _PI symbol value
*/
int32_t fix_Callback_PI(void)
{
warning(WARNING_OBSOLETE, "`_PI` is deprecated; use 3.14159\n");
return double2fix(M_PI);
}
/*
* Print a fixed point value
*/

View File

@@ -212,10 +212,6 @@ static struct KeywordMapping {
{"INCLUDE", T_POP_INCLUDE},
{"PRINT", T_POP_PRINT},
{"PRINTLN", T_POP_PRINTLN},
{"PRINTT", T_POP_PRINTT},
{"PRINTI", T_POP_PRINTI},
{"PRINTV", T_POP_PRINTV},
{"PRINTF", T_POP_PRINTF},
{"EXPORT", T_POP_EXPORT},
{"DS", T_POP_DS},
{"DB", T_POP_DB},

View File

@@ -599,7 +599,6 @@ enum {
%token T_POP_INCLUDE "INCLUDE"
%token T_POP_PRINT "PRINT" T_POP_PRINTLN "PRINTLN"
%token T_POP_PRINTF "PRINTF" T_POP_PRINTT "PRINTT" T_POP_PRINTV "PRINTV" T_POP_PRINTI "PRINTI"
%token T_POP_IF "IF" T_POP_ELIF "ELIF" T_POP_ELSE "ELSE" T_POP_ENDC "ENDC"
%token T_POP_EXPORT "EXPORT"
%token T_POP_DB "DB" T_POP_DS "DS" T_POP_DW "DW" T_POP_DL "DL"
@@ -856,7 +855,7 @@ macroargs : %empty {
/* These commands start with a T_LABEL. */
assignment_directive : equ
| set
| assignment
| rb
| rw
| rl
@@ -866,10 +865,6 @@ assignment_directive : equ
directive : endc
| print
| println
| printf
| printt
| printv
| printi
| export
| db
| dw
@@ -927,12 +922,8 @@ compoundeq : T_POP_ADDEQ { $$ = RPN_ADD; }
equ : T_LABEL T_POP_EQU const { sym_AddEqu($1, $3); }
;
set : T_LABEL T_POP_EQUAL const { sym_AddVar($1, $3); }
assignment : T_LABEL T_POP_EQUAL const { sym_AddVar($1, $3); }
| T_LABEL compoundeq const { compoundAssignment($1, $2, $3); }
| T_LABEL T_POP_SET const {
warning(WARNING_OBSOLETE, "`SET` for variables is deprecated; use `=`\n");
sym_AddVar($1, $3);
}
;
equs : T_LABEL T_POP_EQUS string { sym_AddString($1, $3); }
@@ -1174,14 +1165,6 @@ def_set : def_id T_POP_EQUAL const { sym_AddVar($1, $3); }
| redef_id T_POP_EQUAL const { sym_AddVar($1, $3); }
| def_id compoundeq const { compoundAssignment($1, $2, $3); }
| redef_id compoundeq const { compoundAssignment($1, $2, $3); }
| def_id T_POP_SET const {
warning(WARNING_OBSOLETE, "`SET` for variables is deprecated; use `=`\n");
sym_AddVar($1, $3);
}
| redef_id T_POP_SET const {
warning(WARNING_OBSOLETE, "`SET` for variables is deprecated; use `=`\n");
sym_AddVar($1, $3);
}
;
def_rb : def_id T_POP_RB rs_uconst {
@@ -1295,30 +1278,6 @@ print_expr : const_no_str { printf("$%" PRIX32, $1); }
| string { printf("%s", $1); }
;
printt : T_POP_PRINTT string {
warning(WARNING_OBSOLETE, "`PRINTT` is deprecated; use `PRINT`\n");
printf("%s", $2);
}
;
printv : T_POP_PRINTV const {
warning(WARNING_OBSOLETE, "`PRINTV` is deprecated; use `PRINT`\n");
printf("$%" PRIX32, $2);
}
;
printi : T_POP_PRINTI const {
warning(WARNING_OBSOLETE, "`PRINTI` is deprecated; use `PRINT` with `STRFMT` \"%%d\"\n");
printf("%" PRId32, $2);
}
;
printf : T_POP_PRINTF const {
warning(WARNING_OBSOLETE, "`PRINTF` is deprecated; use `PRINT` with `STRFMT` \"%%f\"\n");
fix_Print($2);
}
;
const_3bit : const {
int32_t value = $1;

View File

@@ -790,14 +790,4 @@ void sym_Init(time_t now)
#undef addString
sym_SetCurrentSymbolScope(NULL);
anonLabelID = 0;
/* _PI is deprecated */
struct Symbol *_PISymbol = createBuiltinSymbol("_PI");
_PISymbol->type = SYM_EQU;
_PISymbol->src = NULL;
_PISymbol->fileLine = 0;
_PISymbol->hasCallback = true;
_PISymbol->numCallback = fix_Callback_PI;
}
anonLabelID = 0;}

View File

@@ -1,3 +0,0 @@
; Remove this test case when _PI is removed.
PRINTLN "{f:_PI}"
PURGE _PI

View File

@@ -1,5 +0,0 @@
warning: deprecated-pi.asm(2): [-Wobsolete]
`_PI` is deprecated; use 3.14159
error: deprecated-pi.asm(3):
Built-in symbol '_PI' cannot be purged
error: Assembly aborted (1 error)!

View File

@@ -1 +0,0 @@
3.14159