Add internals feature.
This commit is contained in:
@@ -65,20 +65,34 @@ impl AST {
|
||||
}
|
||||
|
||||
/// Get the statements.
|
||||
#[cfg(not(feature = "internals"))]
|
||||
pub(crate) fn statements(&self) -> &Vec<Stmt> {
|
||||
&self.0
|
||||
}
|
||||
|
||||
/// Get the statements.
|
||||
#[cfg(feature = "internals")]
|
||||
pub fn statements(&self) -> &Vec<Stmt> {
|
||||
&self.0
|
||||
}
|
||||
|
||||
/// Get a mutable reference to the statements.
|
||||
pub(crate) fn statements_mut(&mut self) -> &mut Vec<Stmt> {
|
||||
&mut self.0
|
||||
}
|
||||
|
||||
/// Get the script-defined functions.
|
||||
/// Get the internal `Module` containing all script-defined functions.
|
||||
#[cfg(not(feature = "internals"))]
|
||||
pub(crate) fn lib(&self) -> &Module {
|
||||
&self.1
|
||||
}
|
||||
|
||||
/// Get the internal `Module` containing all script-defined functions.
|
||||
#[cfg(feature = "internals")]
|
||||
pub fn lib(&self) -> &Module {
|
||||
&self.1
|
||||
}
|
||||
|
||||
/// Merge two `AST` into one. Both `AST`'s are untouched and a new, merged, version
|
||||
/// is returned.
|
||||
///
|
||||
|
Reference in New Issue
Block a user