Wrap up 0.19.10.
This commit is contained in:
15
src/ast.rs
15
src/ast.rs
@@ -1058,13 +1058,13 @@ impl Stmt {
|
||||
}
|
||||
}
|
||||
|
||||
/// _(INTERNALS)_ A custom syntax definition.
|
||||
/// _(INTERNALS)_ A custom syntax expression.
|
||||
/// Exported under the `internals` feature only.
|
||||
///
|
||||
/// # WARNING
|
||||
///
|
||||
/// This type is volatile and may change.
|
||||
#[derive(Clone, Hash)]
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
pub struct CustomExpr {
|
||||
/// List of keywords.
|
||||
pub keywords: StaticVec<Expr>,
|
||||
@@ -1074,17 +1074,6 @@ pub struct CustomExpr {
|
||||
pub scope_delta: isize,
|
||||
}
|
||||
|
||||
impl fmt::Debug for CustomExpr {
|
||||
#[inline(always)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("CustomExpr { keywords:")?;
|
||||
fmt::Debug::fmt(&self.keywords, f)?;
|
||||
f.write_str(", tokens:")?;
|
||||
fmt::Debug::fmt(&self.tokens, f)?;
|
||||
f.write_str("}")
|
||||
}
|
||||
}
|
||||
|
||||
/// _(INTERNALS)_ A binary expression.
|
||||
/// Exported under the `internals` feature only.
|
||||
///
|
||||
|
@@ -101,6 +101,14 @@ impl Engine {
|
||||
/// * `keywords` holds a slice of strings that define the custom syntax.
|
||||
/// * `new_vars` is the number of new variables declared by this custom syntax, or the number of variables removed (if negative).
|
||||
/// * `func` is the implementation function.
|
||||
///
|
||||
/// # Notes
|
||||
///
|
||||
/// If `new_vars` is positive, then a number of new variables are expected to be pushed into the
|
||||
/// current [`Scope`][crate::Scope].
|
||||
///
|
||||
/// If `new_vars` is negative, then it is expected that only the top `new_vars` variables in the
|
||||
/// current [`Scope`][crate::Scope] will be _popped_. Do not randomly remove variables.
|
||||
pub fn register_custom_syntax<S: AsRef<str> + Into<ImmutableString>>(
|
||||
&mut self,
|
||||
keywords: impl AsRef<[S]>,
|
||||
|
Reference in New Issue
Block a user