Skip to content

[#809] Improve interpreter re-iterating on LOOP instr

Moremi Vannak requested to merge rinn7e/#809-loop into master

Description

Problem: Our interpreter does not treat loops and meta instructions in a proper way. Once execution of a loop comes to repeating the loop's body, it just recursively runs on LOOP body here. But if LOOP instruction had a source location or meta attached to it, they won't appear on that repetitions

Solution: Add isMetaWrapper to InterpreterState which build a wrapper attaching Meta and WithLoc along the way. This wrapper the is used when it meets loop instruction.

Related issue(s)

Resolves #809 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Moremi Vannak

Merge request reports