I get the following error from codespan_reporting::term::emit: IndexTooLarge { given: 46, max: 46 }.
This appears to be caused by an error that spans up to the end of the file (final newline included); a dbg! print indicates that the Label's range is 4..46, which does exclude that final byte, and thus seems like it should be valid to me.
Here is how to reproduce:
- Grab this commit
- Store the following code1 somewhere (say
/tmp/test.asm):
MACRO m
PRINTLN "Hello macro World!"
ENDM
m
cargo run /tmp/test.asm
- Note:
wc -c /tmp/test.asm reports 46, so at least that seems to check out.
(Sorry, that's not quite a MCVE, but it works and does I believe enough debug printing. I can try reducing it if necessary.)
PS: thank you very much for your library!
I get the following error from
codespan_reporting::term::emit:IndexTooLarge { given: 46, max: 46 }.This appears to be caused by an error that spans up to the end of the file (final newline included); a
dbg!print indicates that theLabel'srangeis4..46, which does exclude that final byte, and thus seems like it should be valid to me.Here is how to reproduce:
/tmp/test.asm):cargo run /tmp/test.asmwc -c /tmp/test.asmreports 46, so at least that seems to check out.(Sorry, that's not quite a MCVE, but it works and does I believe enough debug printing. I can try reducing it if necessary.)
PS: thank you very much for your library!
Footnotes
This code is not supposed to produce an error, but I have a bug in my parser; that said, this issue might still trigger from legitimate "unterminated X" errors, I think. ↩