mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 23:23:50 +03:00
Add id to Node
This commit is contained in:
parent
d654182095
commit
6ab280a935
@ -25,6 +25,12 @@ pub trait Node:
|
||||
|
||||
/// Sets the span of the node.
|
||||
fn set_span(&mut self, span: Span);
|
||||
|
||||
/// Returns the ID of the node.
|
||||
fn id(&self) -> usize;
|
||||
|
||||
/// Sets the ID of the node.
|
||||
fn set_id(&mut self, id: usize);
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
@ -38,6 +44,14 @@ macro_rules! simple_node_impl {
|
||||
fn set_span(&mut self, span: Span) {
|
||||
self.span = span;
|
||||
}
|
||||
|
||||
fn id(&self) -> usize {
|
||||
self.id
|
||||
}
|
||||
|
||||
fn set_id(&mut self, id: usize) {
|
||||
self.id = id;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user