Remove Meta type
This commit is contained in:
parent
fd3922d866
commit
03f8abac6a
@ -1,8 +1,6 @@
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::convert::From;
|
|
||||||
|
|
||||||
use crate::derivative::Derivative;
|
use crate::derivative::Derivative;
|
||||||
use crate::symbol_table::FullyQualifiedSymbolName;
|
|
||||||
|
|
||||||
mod operators;
|
mod operators;
|
||||||
pub use operators::*;
|
pub use operators::*;
|
||||||
@ -41,40 +39,6 @@ impl ItemIdStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
|
||||||
pub struct Meta<T> {
|
|
||||||
pub n: T,
|
|
||||||
pub fqsn: Option<FullyQualifiedSymbolName>
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> Meta<T> {
|
|
||||||
pub fn new(n: T) -> Meta<T> {
|
|
||||||
Meta { n,
|
|
||||||
fqsn: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn node(&self) -> &T {
|
|
||||||
&self.n
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mut_node(&mut self) -> &mut T {
|
|
||||||
&mut self.n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO this PartialEq is here to make tests work - find a way to make it not necessary
|
|
||||||
#[derive(Clone, Debug, Default, PartialEq)]
|
|
||||||
struct SourceMap {
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<Expression> for Meta<Expression> {
|
|
||||||
fn from(expr: Expression) -> Meta<Expression> {
|
|
||||||
Meta::new(expr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Derivative, Debug)]
|
#[derive(Derivative, Debug)]
|
||||||
#[derivative(PartialEq)]
|
#[derivative(PartialEq)]
|
||||||
pub struct AST {
|
pub struct AST {
|
||||||
|
Loading…
Reference in New Issue
Block a user