aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_macros/src/lib.rs')
-rw-r--r--mingling_macros/src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs
index 175c7e5..7dd2fe2 100644
--- a/mingling_macros/src/lib.rs
+++ b/mingling_macros/src/lib.rs
@@ -44,6 +44,12 @@ mod renderer;
#[cfg(feature = "comp")]
mod suggest;
+pub(crate) const DEFAULT_PROGRAM_NAME: &str = "ThisProgram";
+
+pub(crate) fn default_program_ident() -> Ident {
+ Ident::new(DEFAULT_PROGRAM_NAME, proc_macro2::Span::call_site())
+}
+
// Global variables
#[cfg(feature = "general_renderer")]
pub(crate) static GENERAL_RENDERERS: Lazy<Mutex<BTreeSet<String>>> =
@@ -1549,7 +1555,7 @@ pub fn suggest_enum(input: TokenStream) -> TokenStream {
fn read_name(input: &TokenStream) -> Ident {
if input.is_empty() {
- Ident::new("ThisProgram", proc_macro2::Span::call_site())
+ Ident::new(DEFAULT_PROGRAM_NAME, proc_macro2::Span::call_site())
} else {
syn::parse(input.clone()).unwrap()
}