mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove deprecated features
Trimming off the fat! - GLOBAL and XDEF keywords - Colon-less global labels - *-comments
This commit is contained in:
@@ -1611,18 +1611,6 @@ static int yylex_NORMAL(void)
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
/* Ignore whitespace and comments */
|
/* Ignore whitespace and comments */
|
||||||
|
|
||||||
case '*':
|
|
||||||
if (!lexerState->atLineStart) { /* Either MUL or EXP */
|
|
||||||
secondChar = peek(0);
|
|
||||||
if (secondChar == '*') {
|
|
||||||
shiftChars(1);
|
|
||||||
return T_OP_EXP;
|
|
||||||
}
|
|
||||||
return T_OP_MUL;
|
|
||||||
}
|
|
||||||
warning(WARNING_OBSOLETE,
|
|
||||||
"'*' is deprecated for comments, please use ';' instead\n");
|
|
||||||
/* fallthrough */
|
|
||||||
case ';':
|
case ';':
|
||||||
discardComment();
|
discardComment();
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
@@ -1658,55 +1646,62 @@ static int yylex_NORMAL(void)
|
|||||||
return T_COMMA;
|
return T_COMMA;
|
||||||
|
|
||||||
/* Handle ambiguous 1- or 2-char tokens */
|
/* Handle ambiguous 1- or 2-char tokens */
|
||||||
|
|
||||||
|
case '*': /* Either MUL or EXP */
|
||||||
|
if (peek(0) == '*') {
|
||||||
|
shiftChars(1);
|
||||||
|
return T_OP_EXP;
|
||||||
|
}
|
||||||
|
return T_OP_MUL;
|
||||||
|
|
||||||
case '/': /* Either division or a block comment */
|
case '/': /* Either division or a block comment */
|
||||||
secondChar = peek(0);
|
if (peek(0) == '*') {
|
||||||
if (secondChar == '*') {
|
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
discardBlockComment();
|
discardBlockComment();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return T_OP_DIV;
|
return T_OP_DIV;
|
||||||
|
|
||||||
case '|': /* Either binary or logical OR */
|
case '|': /* Either binary or logical OR */
|
||||||
secondChar = peek(0);
|
if (peek(0) == '|') {
|
||||||
if (secondChar == '|') {
|
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_LOGICOR;
|
return T_OP_LOGICOR;
|
||||||
}
|
}
|
||||||
return T_OP_OR;
|
return T_OP_OR;
|
||||||
|
|
||||||
case '=': /* Either SET alias, or EQ */
|
case '=': /* Either SET alias, or EQ */
|
||||||
secondChar = peek(0);
|
if (peek(0) == '=') {
|
||||||
if (secondChar == '=') {
|
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_LOGICEQU;
|
return T_OP_LOGICEQU;
|
||||||
}
|
}
|
||||||
return T_POP_EQUAL;
|
return T_POP_EQUAL;
|
||||||
|
|
||||||
case '<': /* Either a LT, LTE, or left shift */
|
case '<': /* Either a LT, LTE, or left shift */
|
||||||
secondChar = peek(0);
|
switch (peek(0)) {
|
||||||
if (secondChar == '=') {
|
case '=':
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_LOGICLE;
|
return T_OP_LOGICLE;
|
||||||
} else if (secondChar == '<') {
|
case '<':
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_SHL;
|
return T_OP_SHL;
|
||||||
}
|
default:
|
||||||
return T_OP_LOGICLT;
|
return T_OP_LOGICLT;
|
||||||
|
}
|
||||||
|
|
||||||
case '>': /* Either a GT, GTE, or right shift */
|
case '>': /* Either a GT, GTE, or right shift */
|
||||||
secondChar = peek(0);
|
switch (peek(0)) {
|
||||||
if (secondChar == '=') {
|
case '=':
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_LOGICGE;
|
return T_OP_LOGICGE;
|
||||||
} else if (secondChar == '>') {
|
case '>':
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_SHR;
|
return T_OP_SHR;
|
||||||
}
|
default:
|
||||||
return T_OP_LOGICGT;
|
return T_OP_LOGICGT;
|
||||||
|
}
|
||||||
|
|
||||||
case '!': /* Either a NEQ, or negation */
|
case '!': /* Either a NEQ, or negation */
|
||||||
secondChar = peek(0);
|
if (peek(0) == '=') {
|
||||||
if (secondChar == '=') {
|
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return T_OP_LOGICNE;
|
return T_OP_LOGICNE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,9 +108,6 @@ void opt_Parse(char *s)
|
|||||||
error("Must specify exactly 2 characters for option 'b'\n");
|
error("Must specify exactly 2 characters for option 'b'\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'z':
|
|
||||||
warning(WARNING_OBSOLETE, "Option 'z' is a deprecated alias for 'p'\n");
|
|
||||||
/* fallthrough */
|
|
||||||
case 'p':
|
case 'p':
|
||||||
if (strlen(&s[1]) <= 2) {
|
if (strlen(&s[1]) <= 2) {
|
||||||
int result;
|
int result;
|
||||||
|
|||||||
@@ -568,10 +568,6 @@ label : /* empty */
|
|||||||
| T_LOCAL_ID {
|
| T_LOCAL_ID {
|
||||||
sym_AddLocalLabel($1);
|
sym_AddLocalLabel($1);
|
||||||
}
|
}
|
||||||
| T_LABEL {
|
|
||||||
warning(WARNING_OBSOLETE, "Non-local labels without a colon are deprecated\n");
|
|
||||||
sym_AddLabel($1);
|
|
||||||
}
|
|
||||||
| T_LOCAL_ID T_COLON {
|
| T_LOCAL_ID T_COLON {
|
||||||
sym_AddLocalLabel($1);
|
sym_AddLocalLabel($1);
|
||||||
}
|
}
|
||||||
@@ -898,17 +894,7 @@ purge_list : purge_list_entry
|
|||||||
purge_list_entry : scoped_id { sym_Purge($1); }
|
purge_list_entry : scoped_id { sym_Purge($1); }
|
||||||
;
|
;
|
||||||
|
|
||||||
export : export_token export_list
|
export : T_POP_EXPORT export_list
|
||||||
;
|
|
||||||
|
|
||||||
export_token : T_POP_EXPORT
|
|
||||||
| T_POP_GLOBAL {
|
|
||||||
warning(WARNING_OBSOLETE,
|
|
||||||
"`GLOBAL` is a deprecated synonym for `EXPORT`\n");
|
|
||||||
}
|
|
||||||
| T_POP_XDEF {
|
|
||||||
warning(WARNING_OBSOLETE, "`XDEF` is a deprecated synonym for `EXPORT`\n");
|
|
||||||
}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
export_list : export_list_entry
|
export_list : export_list_entry
|
||||||
|
|||||||
Reference in New Issue
Block a user