Merge pull request #61 from Eliah-Lakhin/native-call-context-improvements
Minor improvements for NativeCallContext introspection
This commit is contained in:
commit
c98d0fff40
@ -224,7 +224,11 @@ impl AST {
|
|||||||
/// Set the source.
|
/// Set the source.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn set_source<S: Into<ImmutableString>>(&mut self, source: Option<S>) {
|
pub fn set_source<S: Into<ImmutableString>>(&mut self, source: Option<S>) {
|
||||||
self.source = source.map(|s| s.into())
|
self.source = source.map(|s| s.into());
|
||||||
|
|
||||||
|
if let Some(module) = Shared::get_mut(&mut self.functions) {
|
||||||
|
module.set_id(self.source.clone());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// Get the statements.
|
/// Get the statements.
|
||||||
#[cfg(not(feature = "internals"))]
|
#[cfg(not(feature = "internals"))]
|
||||||
|
@ -251,8 +251,8 @@ impl Module {
|
|||||||
self.id.as_ref().map(|s| s.as_str())
|
self.id.as_ref().map(|s| s.as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the ID of the [`Module`], if any.
|
/// Get the ID of the [`Module`] as an [`ImmutableString`], if any.
|
||||||
pub(crate) fn id_raw(&self) -> &Option<ImmutableString> {
|
pub fn id_raw(&self) -> &Option<ImmutableString> {
|
||||||
&self.id
|
&self.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user