use std::sync::OnceLock; use enum_iterator::{all, Sequence}; use crate::Identifier; pub fn all_built_in_identifiers() -> impl Iterator { all() } const OPTION: OnceLock = OnceLock::new(); const NONE: OnceLock = OnceLock::new(); #[derive(Sequence)] pub enum BuiltInIdentifier { Option, None, } impl BuiltInIdentifier { pub fn get(&self) -> &Identifier { match self { BuiltInIdentifier::Option => { return OPTION.get_or_init(|| Identifier::new("Option")); } BuiltInIdentifier::None => return NONE.get_or_init(|| Identifier::new("None")), } } }