Browse Source

Parse the OP_IS instruction.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
fa5c2e1f5e
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      engine/parser.c

+ 9
- 0
engine/parser.c View File

@ -1056,6 +1056,15 @@ static sxi32 ExprMakeTree(ph7_gen_state *pGen, ph7_expr_node **apNode, sxi32 nTo
iTmp = iRight;
iRight = iLeft;
iLeft = iTmp;
} else if(pNode->pOp->iOp == EXPR_OP_IS) {
sxu32 nKwrd = 0;
if(apNode[iRight]->pStart->nType == PH7_TK_KEYWORD) {
nKwrd = SX_PTR_TO_INT(apNode[iRight]->pStart->pUserData);
if(nKwrd && (nKwrd & PH7_KEYWORD_TYPEDEF) == 0) {
PH7_GenCompileError(pGen, E_ERROR, pNode->pStart->nLine,
"'%z': Unexpected keyword '%z'", &pNode->pOp->sOp, &apNode[iRight]->pStart->sData);
}
}
}
/* Link the node to the tree */
pNode->pLeft = apNode[iLeft];

Loading…
Cancel
Save