Closed thenorili closed 9 months ago
Yeah, this seems really strange. I can see the weird behavior if I add another instruction r1 5
. I'll need to do a deep dive in the code.
This seems to be fixed on v0.13.5! Can you please let me know if you still experience the issue?
If you run the code below, you'll see that the last instruction greedily ignores the whitespace and parses 'r1 5' as 'r15'. I understand that it grabs the shortest output, but this is ignoring whitespace to force a match. I mention this because I think this could be the root cause of the issue.
If you uncomment 'add r1 4 r0', you'll see "unknown symbol 'r1'" and the stacktrace will indicate it's parsing r1 as an immediate despite it not matching the pattern and producing a longer output.
This is worked around by adding a prefix for immediates, but it seems to break the parsing rules about respecting whitespace as a part of the pattern and about prioritizing the match that produces the shortest output.