Skip to content

Commit

Permalink
refactor(compiler): Remove unnecessary tforloopInstruction variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bytexenon committed Jun 30, 2024
1 parent e2c41d6 commit 6b1dd59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion the-tiny-lua-compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ function InstructionGenerator.generate(ast)
updateJumpInstruction(startJmpInstructionIndex)
-- OP_TFORLOOP [A, C] R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2))
-- if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++
local tforloopInstruction = addInstruction("TFORLOOP", forGeneratorRegister, 0, #iteratorVariables)
addInstruction("TFORLOOP", forGeneratorRegister, 0, #iteratorVariables)
-- OP_JMP [A, sBx] pc+=sBx
addInstruction("JMP", 0, loopStart - #code - 1)
updateJumpInstructions(breakInstructions)
Expand Down

0 comments on commit 6b1dd59

Please sign in to comment.