fix compile error without "shulkerbox" feature

This commit is contained in:
Moritz Hölting 2025-08-27 11:45:30 +02:00
parent d0cee40524
commit d9f2d99c3a
1 changed files with 11 additions and 5 deletions

View File

@ -1,7 +1,8 @@
//! Utility methods for transpiling //! Utility methods for transpiling
use std::{fmt::Display, str::FromStr, sync::Arc}; use std::{fmt::Display, str::FromStr};
#[cfg(feature = "shulkerbox")]
use crate::{ use crate::{
base::{self, source_file::SourceElement as _, Handler}, base::{self, source_file::SourceElement as _, Handler},
syntax::syntax_tree::{ syntax::syntax_tree::{
@ -10,11 +11,12 @@ use crate::{
}, },
transpile::{ transpile::{
error::{TranspileError, UnknownIdentifier}, error::{TranspileError, UnknownIdentifier},
expression::ComptimeValue,
Scope, TranspileResult, VariableData, Scope, TranspileResult, VariableData,
}, },
}; };
#[cfg(feature = "shulkerbox")]
use super::expression::ComptimeValue; use std::sync::Arc;
/// String that can contain macros /// String that can contain macros
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@ -256,6 +258,7 @@ where
} }
} }
#[cfg(feature = "shulkerbox")]
impl AnyStringLiteral { impl AnyStringLiteral {
/// Convert the any string literal to a macro string, using the provided scope to resolve variables /// Convert the any string literal to a macro string, using the provided scope to resolve variables
/// ///
@ -273,6 +276,7 @@ impl AnyStringLiteral {
} }
} }
#[cfg(feature = "shulkerbox")]
impl TemplateStringLiteral { impl TemplateStringLiteral {
/// Convert the template string literal to a macro string, using the provided scope to resolve variables /// Convert the template string literal to a macro string, using the provided scope to resolve variables
/// ///
@ -345,7 +349,9 @@ impl TemplateStringLiteral {
Ok(macro_string) Ok(macro_string)
} else { } else {
Ok(MacroString::String(self.as_str(scope, handler)?.into_owned())) Ok(MacroString::String(
self.as_str(scope, handler)?.into_owned(),
))
} }
} }
} }