pub enum Preceding<T> {
Parent(T),
Previous(T),
}
Expand description
A statement in an AST may have:
- A previous statement
- A next statement
- A child statement
- A parent statement
Consider the example:
x = -10
loop
x = x + 1
if x
break
x = 2
this can be represented as:
┌──────────┐
│x = -10 │
└──────────┘
│
┌──────────┐
│loop │
└──────────┘
│ ╲
┌──────────┐ ┌─────────┐
│x = 2 │ │x = x + 1│
└──────────┘ └─────────┘
│
┌─────────┐
│if x │
└─────────┘
╲
┌─────────┐
│break │
└─────────┘
this is a simplified tree structure.
Variants§
Implementations§
Trait Implementations§
impl<T: Copy> Copy for Preceding<T>
impl<T: Eq> Eq for Preceding<T>
impl<T> StructuralPartialEq for Preceding<T>
Auto Trait Implementations§
impl<T> Freeze for Preceding<T>where
T: Freeze,
impl<T> RefUnwindSafe for Preceding<T>where
T: RefUnwindSafe,
impl<T> Send for Preceding<T>where
T: Send,
impl<T> Sync for Preceding<T>where
T: Sync,
impl<T> Unpin for Preceding<T>where
T: Unpin,
impl<T> UnwindSafe for Preceding<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more