Add a location to verifier error messages.

The verifier reports the 'location' of an error message as a reference
to the entity that has a problem. This uses the 'AnyEntity' type to
refer to instructions/values/ebbs etc.

Also add an err! macro similar to the one used by the parser.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-12 14:17:54 -07:00
parent 52aca982a1
commit c3afc1f2be
4 changed files with 53 additions and 18 deletions

View File

@@ -41,7 +41,7 @@ fn verifier_tests_from_source(function_source: &str) {
let result = Verifier::new(&func).run();
match verifier_results[i] {
Some(ref re) => {
assert_eq!(re.is_match(&result.err().unwrap()), true);
assert_eq!(re.is_match(&result.err().unwrap().message), true);
},
None => {
assert_eq!(result, Ok(()));