Add no_custom_syntax.

This commit is contained in:
Stephen Chung
2022-07-05 22:59:03 +08:00
parent b6528bd51d
commit b4dbc7619a
18 changed files with 121 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
//! Module implementing custom syntax for [`Engine`].
#![cfg(not(feature = "no_custom_syntax"))]
use crate::ast::Expr;
use crate::func::SendSync;
@@ -153,6 +154,8 @@ pub struct CustomSyntax {
impl Engine {
/// Register a custom syntax with the [`Engine`].
///
/// Not available under `no_custom_syntax`.
///
/// * `symbols` holds a slice of strings that define the custom syntax.
/// * `scope_may_be_changed` specifies variables _may_ be added/removed by this custom syntax.
/// * `func` is the implementation function.
@@ -296,6 +299,8 @@ impl Engine {
}
/// Register a custom syntax with the [`Engine`].
///
/// Not available under `no_custom_syntax`.
///
/// # WARNING - Low Level API
///
/// This function is very low level.