diff --git a/src/compiler/iml/imlvalue.rs b/src/compiler/iml/imlvalue.rs index c8fa9069..7fe4631d 100644 --- a/src/compiler/iml/imlvalue.rs +++ b/src/compiler/iml/imlvalue.rs @@ -97,7 +97,10 @@ impl ImlValue { */ pub fn resolve(&mut self, compiler: &mut Compiler) -> bool { let resolve = match self { - Self::Unresolved(value) => return value.borrow_mut().resolve(compiler), + Self::Unresolved(value) => match value.try_borrow_mut() { + Ok(mut value) => return value.resolve(compiler), + Err(_) => todo!("Recursive resolve()"), + }, Self::Name { offset, name, .. } => compiler.get(offset.clone(), &name), Self::Instance { offset, diff --git a/src/utils.rs b/src/utils.rs index a9be5de9..04a76bab 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -206,15 +206,19 @@ pub(crate) fn testcase(code: &str) { let line = err .get(0) .expect("Expecting stderr but nothing was emitted"); - assert_eq!( - line, - exp, - "{}:{} stderr expects {:?} but got {:?}", - filename, - lines + row + 1, - exp, - line - ); + + if exp != "SKIP" { + assert_eq!( + line, + exp, + "{}:{} stderr expects {:?} but got {:?}", + filename, + lines + row + 1, + exp, + line + ); + } + err.remove(0); } else { /* @@ -228,15 +232,19 @@ pub(crate) fn testcase(code: &str) { let line = out .get(0) .expect("Expecting stdout but nothing was emitted"); - assert_eq!( - line, - exp, - "{}:{} stdout expects {:?} but got {:?}", - filename, - lines + row + 1, - exp, - line - ); + + if exp != "SKIP" { + assert_eq!( + line, + exp, + "{}:{} stdout expects {:?} but got {:?}", + filename, + lines + row + 1, + exp, + line + ); + } + out.remove(0); } } diff --git a/tests/parselet_generic_selfref.tok b/tests/parselet_generic_selfref.tok new file mode 100644 index 00000000..c1397080 --- /dev/null +++ b/tests/parselet_generic_selfref.tok @@ -0,0 +1,12 @@ +Y: X + +X: @ { + 'x' X +} + +Y<'a'> print("Ja!") +X<'x'> print("Jx!") +#--- +#ERR:SKIP +#ERR:not yet implemented: Recursive resolve() +#ERR:SKIP