Is your feature request related to a problem? Please describe.
The assembler's error-handling strategy is modeled after https://eyalkalderon.com/blog/nom-error-recovery/ but our use of the "placeholder" denoting that we came across an invalid input is not comprehensive.
For example, this line of input is perfectly valid:
100| REX₆₆ 200 ** Set X₆₆ to 200.
If we add an extra symbol in there like this:
100| REX₆₆ EXTRA 200 ** Set X₆₆ to 200.
We get a somewhat confusing error:
11:508: expected newline after a program instruction
11:508: expected end-of-file
2022-05-16T08:51:58.375986Z ERROR assemble{input="assembler/examples/hello.tx2as" output="hello.tape"}: tx2m4as: assembly failed: AsmFail(SyntaxError { line: 11, columns: Some((508, 3505)), msg: "expected newline after a program instruction" })
line 11, column 509: expected newline after a program instruction
Describe the solution you'd like
An error message which is more understandable, making use of the existing LocatedSpan code to show the invalid/unsupported input.
Describe alternatives you've considered
I'm hoping that the overall pattern described in Eyal Kalderon's blog post will be sufficient to give a good user experience.
Additional context
See above for an example output.
Is your feature request related to a problem? Please describe.
The assembler's error-handling strategy is modeled after https://eyalkalderon.com/blog/nom-error-recovery/ but our use of the "placeholder" denoting that we came across an invalid input is not comprehensive.
For example, this line of input is perfectly valid:
If we add an extra symbol in there like this:
We get a somewhat confusing error:
Describe the solution you'd like An error message which is more understandable, making use of the existing
LocatedSpan
code to show the invalid/unsupported input.Describe alternatives you've considered I'm hoping that the overall pattern described in Eyal Kalderon's blog post will be sufficient to give a good user experience.
Additional context See above for an example output.