Skip to content

Commit

Permalink
Fix else statements not working
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Livesey committed Sep 15, 2024
1 parent 13f366b commit aa2a207
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/vxbuild-js/statements.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class IfStatementNode extends ast.AstNode {

var skipTrueCode = codeGen.join(
codeGen.bytes(codeGen.vxcTokens.NULL, codeGen.vxcTokens.POS_REF_FORWARD),
codeGen.int32(isTrueCode.length + skipFalseCode.length + isFalseCode.length + 1),
codeGen.int32(isTrueCode.length + skipFalseCode.length + 1),
codeGen.bytes(codeGen.vxcTokens.JUMP_IF_TRUTHY)
);

Expand Down
2 changes: 1 addition & 1 deletion tools/vxbuild/expressions.vxl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ExpressionLeafNode extends ExpressionNode {
assigningToLocalVariable = true;
}

if (false) { // FIXME: Fix issue with `else` and match opening bracket
if (this.maybeEat(tokens, [new ast.TokenQuery(tokeniser.BracketToken, "(")])) {
instance.expectChildByMatching(tokens, [ExpressionNode], namespace);

this.eat(tokens, [new ast.TokenQuery(tokeniser.BracketToken, ")")]);
Expand Down

0 comments on commit aa2a207

Please sign in to comment.