Remove .FEATURE requirement and add documentation
This commit is contained in:
@@ -421,26 +421,27 @@ static ExprNode* FuncDefined (void)
|
||||
static ExprNode* FuncDefinedInstr (void)
|
||||
/* Handle the .DEFINEDINSTR builtin function */
|
||||
{
|
||||
int Instr = 0;
|
||||
int Instr = 0;
|
||||
|
||||
/* Check for a macro or an instruction depending on UbiquitousIdents */
|
||||
|
||||
if (CurTok.Tok == TOK_IDENT) {
|
||||
if (UbiquitousIdents) {
|
||||
/* Macros CAN be instructions, so check for them first */
|
||||
if (FindMacro(&CurTok.SVal) == 0) {
|
||||
if (FindMacro (&CurTok.SVal) == 0) {
|
||||
Instr = FindInstruction (&CurTok.SVal);
|
||||
}
|
||||
} else {
|
||||
/* Macros and symbols may NOT use the names of instructions, so just check for the instruction */
|
||||
Instr = FindInstruction(&CurTok.SVal);
|
||||
Instr = FindInstruction (&CurTok.SVal);
|
||||
}
|
||||
NextTok();
|
||||
} else {
|
||||
Error("Idenitifier expected.");
|
||||
Error ("Idenitifier expected.");
|
||||
}
|
||||
/* Skip the name */
|
||||
NextTok ();
|
||||
|
||||
return GenLiteralExpr(Instr > 0);
|
||||
return GenLiteralExpr (Instr > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ static const char* FeatureKeys[FEAT_COUNT] = {
|
||||
"force_range",
|
||||
"underline_in_numbers",
|
||||
"addrsize",
|
||||
"definedinstr",
|
||||
};
|
||||
|
||||
|
||||
@@ -122,7 +121,6 @@ feature_t SetFeature (const StrBuf* Key)
|
||||
case FEAT_FORCE_RANGE: ForceRange = 1; break;
|
||||
case FEAT_UNDERLINE_IN_NUMBERS: UnderlineInNumbers= 1; break;
|
||||
case FEAT_ADDRSIZE: AddrSize = 1; break;
|
||||
case FEAT_DEFINEDINSTR: DefinedInstr = 1; break;
|
||||
default: /* Keep gcc silent */ break;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ typedef enum {
|
||||
FEAT_FORCE_RANGE,
|
||||
FEAT_UNDERLINE_IN_NUMBERS,
|
||||
FEAT_ADDRSIZE,
|
||||
FEAT_DEFINEDINSTR,
|
||||
|
||||
/* Special value: Number of features available */
|
||||
FEAT_COUNT
|
||||
|
||||
@@ -83,4 +83,3 @@ unsigned char CComments = 0; /* Allow C like comments */
|
||||
unsigned char ForceRange = 0; /* Force values into expected range */
|
||||
unsigned char UnderlineInNumbers = 0; /* Allow underlines in numbers */
|
||||
unsigned char AddrSize = 0; /* Allow .ADDRSIZE function */
|
||||
unsigned char DefinedInstr = 0; /* Allow .DEFINEDINSTR function */
|
||||
|
||||
@@ -85,7 +85,6 @@ extern unsigned char CComments; /* Allow C like comments */
|
||||
extern unsigned char ForceRange; /* Force values into expected range */
|
||||
extern unsigned char UnderlineInNumbers; /* Allow underlines in numbers */
|
||||
extern unsigned char AddrSize; /* Allow .ADDRSIZE function */
|
||||
extern unsigned char DefinedInstr; /* Allow .DEFINEDINSTR function */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -737,13 +737,6 @@ static token_t FindDotKeyword (void)
|
||||
}
|
||||
break;
|
||||
|
||||
case TOK_DEFINEDINSTR:
|
||||
/* Disallow .DEFINEDINSTR function by default */
|
||||
if (DefinedInstr == 0) {
|
||||
return TOK_NONE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user