frroossst / py_mips_debugger

A minimal MIPS python interpreter that allows for easy debugging and improved developer workflow
https://frroossst.github.io/py_mips_debugger/
GNU General Public License v3.0
0 stars 0 forks source link

Implement runtime syntax checking for better error messages #19

Closed frroossst closed 1 year ago

frroossst commented 1 year ago

This allows for better interpreter error messages, if the following line of code is passed, move $t0, 100 the interpreter will throw an error saying invalid register 100 this error originates from registers.py, instead before executing this instruction we can check for the validity of arguments, this will result in a better error message saying something like, 100 is an invalid argument for move, consider making it a register name

Also, get a better way of parsing instructions that relying on whitespaces, li $t0, 100 will be correctly parsed, while li $t0,100 will not.

tldr; rustify the error messages

frroossst commented 1 year ago

I think this is part way there, needs more testing