Error Messaging Redesign
This commit contains the following: * New data types to support full tracebacks * New traceback data type used across stl and ast * Updates to tests * fixes for error messaging in sym and some stl functions
This commit is contained in:
parent
91ad4eed12
commit
789349df48
24 changed files with 837 additions and 374 deletions
|
|
@ -17,7 +17,7 @@ mod lex_tests {
|
|||
fn test_bad_symbol() {
|
||||
let document = String::from("(as@dd)");
|
||||
let output: &str = "Problem lexing document: \"Unparsable token: as@dd\"";
|
||||
assert_eq!(lex(&document).err().unwrap(), output.to_string(),);
|
||||
assert_eq!(lex(&document).err().unwrap().0.first().unwrap().message, output.to_string(),);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -42,14 +42,14 @@ mod lex_tests {
|
|||
fn test_unmatched_list_delim_flat() {
|
||||
let document = String::from("(one two");
|
||||
let output: &str = "Problem lexing document: \"Unmatched list delimiter in input\"";
|
||||
assert_eq!(lex(&document).err().unwrap(), output.to_string(),);
|
||||
assert_eq!(lex(&document).err().unwrap().0.first().unwrap().message, output.to_string(),);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unmatched_list_delim_complex() {
|
||||
let document = String::from("(one two (three)");
|
||||
let output: &str = "Problem lexing document: \"Unmatched list delimiter in input\"";
|
||||
assert_eq!(lex(&document).err().unwrap(), output.to_string(),);
|
||||
assert_eq!(lex(&document).err().unwrap().0.first().unwrap().message, output.to_string(),);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -100,6 +100,6 @@ mod lex_tests {
|
|||
fn test_bad_token_list() {
|
||||
let document = String::from("(one t(wo)");
|
||||
let output: &str = "Problem lexing document: \"list started in middle of another token\"";
|
||||
assert_eq!(lex(&document).err().unwrap(), output.to_string(),);
|
||||
assert_eq!(lex(&document).err().unwrap().0.first().unwrap().message, output.to_string(),);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue