fix bug where error would reference wrong file

This commit is contained in:
Mark
2023-11-24 13:19:38 +01:00
parent 12af47d18a
commit 0a9eea2045
29 changed files with 173 additions and 194 deletions

View File

@@ -23,7 +23,9 @@ impl Config {
// TODO: Type with generics
self.add_type("List".to_string(),
Err(Arc::new(|s, i| {
let t = crate::parsing::types::parse_type(&mut Source::new_from_string_raw(s.to_owned()))?;
let mut src = Source::new_from_string_raw(s.to_owned());
let srca = Arc::new(src.clone());
let t = crate::parsing::types::parse_type(&mut src, &srca)?;
Ok(Arc::new(ListT(crate::parsing::types::type_from_parsed(&t, i)?)))})))
.add_var(
"pop".to_string(),

View File

@@ -21,7 +21,9 @@ impl Config {
self.add_type(
"Thread".to_string(),
Err(Arc::new(|s, i| {
let t = crate::parsing::types::parse_type(&mut Source::new_from_string_raw(s.to_owned()))?;
let mut src = Source::new_from_string_raw(s.to_owned());
let srca = Arc::new(src.clone());
let t = crate::parsing::types::parse_type(&mut src, &srca)?;
Ok(Arc::new(ThreadT(crate::parsing::types::type_from_parsed(&t, i)?)))
})),
)