This commit is contained in:
2024-07-18 16:07:36 +02:00
parent 949b3758fd
commit cc3699bbe7
31 changed files with 1021 additions and 312 deletions

15
orchid-base/src/tokens.rs Normal file
View 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 } }
}