mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-06 23:20:36 +00:00
Minor refactoring, fixed 'or' and 'and' logical operators
This commit is contained in:
@@ -573,6 +573,7 @@ static void and_(CParseState *pstate, bool canAssign, Precedence prec) {
|
||||
int jump = writeJmp(pstate, OP_EJMP); // conditional jump without popping
|
||||
|
||||
writePop(pstate, 1);
|
||||
valuePopped(pstate, 1);
|
||||
expressionPrecedence(pstate, 1, PREC_AND, true);
|
||||
|
||||
patchJmp(pstate, jump);
|
||||
@@ -584,6 +585,7 @@ static void or_(CParseState *pstate, bool canAssign, Precedence prec) {
|
||||
|
||||
patchJmp(pstate, elseJump);
|
||||
writePop(pstate, 1);
|
||||
valuePopped(pstate, 1);
|
||||
|
||||
expressionPrecedence(pstate, 1, PREC_OR, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user