forked from Orchid/orchid
- Removed out-of-stack error reporting - Revised module system to match previous Orchid system - Errors are now in a Vec everywhere - Implemented atoms and lexer - Started implementation of line parser - Tree is now ephemeral to avoid copying Atoms held inside - Moved numbers into std and the shared parser into base - Started implementation of Commands
16 lines
421 B
Rust
16 lines
421 B
Rust
use orchid_api::tree::{Placeholder, PlaceholderKind};
|
|
|
|
use crate::interner::{deintern, Tok};
|
|
|
|
#[derive(Clone, Debug)]
|
|
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 } }
|
|
}
|