[script] add bitshifting

This commit is contained in:
suchmememanyskill
2021-01-02 11:39:14 +01:00
parent e1f292fe0d
commit e0c62cbec4
3 changed files with 25 additions and 3 deletions

View File

@@ -263,6 +263,10 @@ Variable_t solveEquation(scriptCtx_t* ctx, lexarToken_t* tokens, u32 len, u8 sho
res.integerType = res.integerType & val.integerType;
ELIFT(OR)
res.integerType = res.integerType | val.integerType;
ELIFT(BitShiftLeft)
res.integerType = res.integerType << val.integerType;
ELIFT(BitShiftRight)
res.integerType = res.integerType >> val.integerType;
else
return ErrValue(ERRBADOPERATOR);
}
@@ -396,7 +400,7 @@ Variable_t solveEquation(scriptCtx_t* ctx, lexarToken_t* tokens, u32 len, u8 sho
res = val;
}
}
else if (tokens[i].token >= Plus && tokens[i].token <= Selector) {
else if (tokens[i].token >= Plus && tokens[i].token <= BitShiftRight) {
lastToken = tokens[i].token;
}
}