This commit is contained in:
Tom Alexander 2022-10-30 05:48:43 -04:00
parent d1460fed95
commit 7eb8087f9d
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -7,9 +7,11 @@ use nom::error::VerboseError;
use nom::IResult; use nom::IResult;
use nom::Parser; use nom::Parser;
type ContextReference<T> = Option<Rc<ContextLayer<T>>>;
pub struct ContextLayer<T> { pub struct ContextLayer<T> {
data: T, data: T,
parent: Option<Rc<ContextLayer<T>>>, parent: ContextReference<T>,
} }
impl<T> ContextLayer<T> { impl<T> ContextLayer<T> {
@ -21,8 +23,6 @@ impl<T> ContextLayer<T> {
} }
} }
type ContextReference<T> = Option<Rc<ContextLayer<T>>>;
pub struct TestContext<T> { pub struct TestContext<T> {
head: ContextReference<T>, head: ContextReference<T>,
} }