Rename 'instanceof' to 'is'.
All checks were successful
The build was successful.

This commit is contained in:
2019-06-06 11:53:17 +02:00
parent 24c75975e3
commit d0995a4239
4 changed files with 10 additions and 10 deletions

View File

@@ -74,7 +74,7 @@ static sxi32 TokenizeAerScript(SyStream *pStream, SyToken *pToken, void *pUserDa
nKeyword = KeywordCode(pStr->zString, (int)pStr->nByte);
if(nKeyword != PH7_TK_ID) {
if(nKeyword &
(PH7_KEYWORD_NEW | PH7_KEYWORD_CLONE | PH7_KEYWORD_INSTANCEOF)) {
(PH7_KEYWORD_NEW | PH7_KEYWORD_CLONE | PH7_KEYWORD_IS)) {
/* Alpha stream operators [i.e: new,clone,instanceof],save the operator instance for later processing */
pToken->pUserData = (void *)PH7_ExprExtractOperator(pStr, 0);
/* Mark as an operator */
@@ -528,7 +528,6 @@ static sxu32 KeywordCode(const char *z, int n) {
{"final", PH7_KEYWORD_FINAL},
{"finally", PH7_KEYWORD_FINALLY},
{"implements", PH7_KEYWORD_IMPLEMENTS},
{"instanceof", PH7_KEYWORD_INSTANCEOF},
{"interface", PH7_KEYWORD_INTERFACE},
{"namespace", PH7_KEYWORD_NAMESPACE},
{"new", PH7_KEYWORD_NEW},
@@ -573,6 +572,7 @@ static sxu32 KeywordCode(const char *z, int n) {
{"exit", PH7_KEYWORD_EXIT},
{"import", PH7_KEYWORD_IMPORT},
{"include", PH7_KEYWORD_INCLUDE},
{"is", PH7_KEYWORD_IS},
{"require", PH7_KEYWORD_REQUIRE},
{"return", PH7_KEYWORD_RETURN},
};

View File

@@ -53,7 +53,7 @@ static const ph7_expr_op aOpTable[] = {
{ {"(void)", sizeof("(void)") - 1 }, EXPR_OP_TYPECAST, 4, EXPR_OP_ASSOC_RIGHT, PH7_OP_CVT_VOID },
/* Binary operators */
/* Precedence 7,left-associative */
{ {"instanceof", sizeof("instanceof") - 1}, EXPR_OP_INSTOF, 7, EXPR_OP_NON_ASSOC, PH7_OP_IS_A},
{ {"instanceof", sizeof("instanceof") - 1}, EXPR_OP_IS, 7, EXPR_OP_NON_ASSOC, PH7_OP_IS},
{ {"*", sizeof(char)}, EXPR_OP_MUL, 7, EXPR_OP_ASSOC_LEFT, PH7_OP_MUL},
{ {"/", sizeof(char)}, EXPR_OP_DIV, 7, EXPR_OP_ASSOC_LEFT, PH7_OP_DIV},
{ {"%", sizeof(char)}, EXPR_OP_MOD, 7, EXPR_OP_ASSOC_LEFT, PH7_OP_MOD},

View File

@@ -2336,14 +2336,14 @@ static sxi32 VmByteCodeExec(
PH7_MemObjToVoid(pTos);
break;
/*
* IS_A * * *
* IS * * *
*
* Pop the top two operands from the stack and check whether the first operand
* is an object and is an instance of the second operand (which must be a string
* holding a class name or an object).
* Push TRUE on success. FALSE otherwise.
*/
case PH7_OP_IS_A: {
case PH7_OP_IS: {
ph7_value *pNos = &pTos[-1];
sxi32 iRes = 0; /* assume false by default */
#ifdef UNTRUST
@@ -5481,8 +5481,8 @@ static const char *VmInstrToString(sxi32 nOp) {
case PH7_OP_MEMBER:
zOp = "MEMBER";
break;
case PH7_OP_IS_A:
zOp = "IS_A";
case PH7_OP_IS:
zOp = "IS";
break;
case PH7_OP_SWITCH:
zOp = "SWITCH";