function for turning lval type into a string for error reporting
update error messages to be more descriptive