Encapsulate structures.

This commit is contained in:
Stephen Chung
2020-12-14 23:05:13 +08:00
parent 5ea6efe6fd
commit 17310ef576
4 changed files with 18 additions and 26 deletions

View File

@@ -858,11 +858,11 @@ impl Stmt {
#[derive(Clone)]
pub struct CustomExpr {
/// Implementation function.
pub(crate) func: Shared<FnCustomSyntaxEval>,
pub func: Shared<FnCustomSyntaxEval>,
/// List of keywords.
pub(crate) keywords: StaticVec<Expr>,
pub keywords: StaticVec<Expr>,
/// List of tokens actually parsed.
pub(crate) tokens: Vec<ImmutableString>,
pub tokens: Vec<ImmutableString>,
}
impl fmt::Debug for CustomExpr {
@@ -876,24 +876,6 @@ impl fmt::Debug for CustomExpr {
}
}
impl CustomExpr {
/// Get the implementation function for this custom syntax.
#[inline(always)]
pub fn func(&self) -> &FnCustomSyntaxEval {
self.func.as_ref()
}
/// Get the keywords for this custom syntax.
#[inline(always)]
pub fn keywords(&self) -> &[Expr] {
&self.keywords
}
/// Get the actual parsed tokens for this custom syntax.
#[inline(always)]
pub fn tokens(&self) -> &[ImmutableString] {
&self.tokens
}
}
/// _(INTERNALS)_ A binary expression.
/// Exported under the `internals` feature only.
///