forked from Orchid/orchid
bkp
This commit is contained in:
15
orchid-base/src/tokens.rs
Normal file
15
orchid-base/src/tokens.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use orchid_api::tree::{Placeholder, PlaceholderKind};
|
||||
|
||||
use crate::interner::{deintern, Tok};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct OwnedPh {
|
||||
pub name: Tok<String>,
|
||||
pub kind: PlaceholderKind,
|
||||
}
|
||||
impl OwnedPh {
|
||||
pub fn to_api(&self) -> Placeholder {
|
||||
Placeholder { name: self.name.marker(), kind: self.kind.clone() }
|
||||
}
|
||||
pub fn from_api(ph: Placeholder) -> Self { Self { name: deintern(ph.name), kind: ph.kind } }
|
||||
}
|
||||
Reference in New Issue
Block a user