shithub: rgbds

Download patch

ref: b037d54f64917b1df175f33226ef21f20f94b0f7
parent: 80df6640e35b76c4fa0d67759abfa8517f832b2f
author: ISSOtm <eldredhabert0@gmail.com>
date: Sat May 21 17:20:44 EDT 2022

Remove deprecated symbols

Fixes #896

--- a/include/asm/fixpoint.h
+++ b/include/asm/fixpoint.h
@@ -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);
--- a/src/asm/fixpoint.c
+++ b/src/asm/fixpoint.c
@@ -31,16 +31,6 @@
 #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
  */
 void fix_Print(int32_t i)
--- a/src/asm/lexer.c
+++ b/src/asm/lexer.c
@@ -212,10 +212,6 @@
 	{"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},
--- a/src/asm/parser.y
+++ b/src/asm/parser.y
@@ -599,7 +599,6 @@
 
 %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 @@
 
 /* These commands start with a T_LABEL. */
 assignment_directive	: equ
-		| set
+		| assignment
 		| rb
 		| rw
 		| rl
@@ -866,10 +865,6 @@
 directive	: endc
 		| print
 		| println
-		| printf
-		| printt
-		| printv
-		| printi
 		| export
 		| db
 		| dw
@@ -927,12 +922,8 @@
 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 @@
 		| 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 {
@@ -1293,30 +1276,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 {
--- a/src/asm/symbol.c
+++ b/src/asm/symbol.c
@@ -790,14 +790,4 @@
 #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;}
--- a/test/asm/deprecated-pi.asm
+++ /dev/null
@@ -1,3 +1,0 @@
-; Remove this test case when _PI is removed.
-	PRINTLN "{f:_PI}"
-	PURGE _PI
--- a/test/asm/deprecated-pi.err
+++ /dev/null
@@ -1,5 +1,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)!
--- a/test/asm/deprecated-pi.out
+++ /dev/null
@@ -1,1 +1,0 @@
-3.14159