Use lower case for feature marker.

This commit is contained in:
Stephen Chung 2021-07-25 22:56:05 +08:00
parent 6cb710652b
commit c7498503ba
12 changed files with 56 additions and 56 deletions

View File

@ -40,7 +40,7 @@ pub enum FnAccess {
Private,
}
/// _(INTERNALS)_ A type containing information on a scripted function.
/// _(internals)_ A type containing information on a scripted function.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -68,7 +68,7 @@ pub struct ScriptFnDef {
/// Not available under `no_closure`.
#[cfg(not(feature = "no_closure"))]
pub externals: std::collections::BTreeSet<Identifier>,
/// _(METADATA)_ Function doc-comments (if any).
/// _(metadata)_ Function doc-comments (if any).
/// Exported under the `metadata` feature only.
///
/// Not available under `no_function`.
@ -104,7 +104,7 @@ impl fmt::Display for ScriptFnDef {
#[cfg(not(feature = "no_function"))]
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
pub struct ScriptFnMetadata<'a> {
/// _(METADATA)_ Function doc-comments (if any).
/// _(metadata)_ Function doc-comments (if any).
/// Exported under the `metadata` feature only.
///
/// Not available under `no_function`.
@ -278,7 +278,7 @@ impl AST {
pub(crate) fn statements(&self) -> &[Stmt] {
&self.body.0
}
/// _(INTERNALS)_ Get the statements.
/// _(internals)_ Get the statements.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[deprecated = "this method is volatile and may change"]
@ -303,7 +303,7 @@ impl AST {
pub(crate) fn shared_lib(&self) -> Shared<Module> {
self.functions.clone()
}
/// _(INTERNALS)_ Get the internal shared [`Module`] containing all script-defined functions.
/// _(internals)_ Get the internal shared [`Module`] containing all script-defined functions.
/// Exported under the `internals` feature only.
///
/// Not available under `no_function` or `no_module`.
@ -323,7 +323,7 @@ impl AST {
pub(crate) fn lib(&self) -> &Module {
&self.functions
}
/// _(INTERNALS)_ Get the internal [`Module`] containing all script-defined functions.
/// _(internals)_ Get the internal [`Module`] containing all script-defined functions.
/// Exported under the `internals` feature only.
///
/// Not available under `no_function`.
@ -344,7 +344,7 @@ impl AST {
) -> Option<Shared<crate::module::resolvers::StaticModuleResolver>> {
self.resolver.clone()
}
/// _(INTERNALS)_ Get the embedded [module resolver][crate::ModuleResolver].
/// _(internals)_ Get the embedded [module resolver][crate::ModuleResolver].
/// Exported under the `internals` feature only.
///
/// Not available under `no_module`.
@ -762,7 +762,7 @@ impl AST {
true
}
/// _(INTERNALS)_ Recursively walk the [`AST`], including function bodies (if any).
/// _(internals)_ Recursively walk the [`AST`], including function bodies (if any).
/// Return `false` from the callback to terminate the walk.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
@ -816,7 +816,7 @@ impl AsRef<Module> for AST {
}
}
/// _(INTERNALS)_ An identifier containing a name and a [position][Position].
/// _(internals)_ An identifier containing a name and a [position][Position].
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -837,7 +837,7 @@ impl fmt::Debug for Ident {
}
}
/// _(INTERNALS)_ A type encapsulating the mode of a `return`/`throw` statement.
/// _(internals)_ A type encapsulating the mode of a `return`/`throw` statement.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -851,7 +851,7 @@ pub enum ReturnType {
Exception,
}
/// _(INTERNALS)_ An [`AST`] node, consisting of either an [`Expr`] or a [`Stmt`].
/// _(internals)_ An [`AST`] node, consisting of either an [`Expr`] or a [`Stmt`].
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -875,7 +875,7 @@ impl<'a> From<&'a Expr> for ASTNode<'a> {
}
}
/// _(INTERNALS)_ A statements block.
/// _(internals)_ A statements block.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -950,7 +950,7 @@ impl From<StmtBlock> for Stmt {
}
}
/// _(INTERNALS)_ A statement.
/// _(internals)_ A statement.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1375,7 +1375,7 @@ impl Stmt {
}
}
/// _(INTERNALS)_ A custom syntax expression.
/// _(internals)_ A custom syntax expression.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1391,7 +1391,7 @@ pub struct CustomExpr {
pub tokens: StaticVec<Identifier>,
}
/// _(INTERNALS)_ A binary expression.
/// _(internals)_ A binary expression.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1405,7 +1405,7 @@ pub struct BinaryExpr {
pub rhs: Expr,
}
/// _(INTERNALS)_ An op-assignment operator.
/// _(internals)_ An op-assignment operator.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1443,7 +1443,7 @@ impl OpAssignment<'_> {
}
}
/// _(INTERNALS)_ An set of function call hashes.
/// _(internals)_ An set of function call hashes.
/// Exported under the `internals` feature only.
///
/// Two separate hashes are pre-calculated because of the following pattern:
@ -1530,7 +1530,7 @@ impl FnCallHashes {
}
}
/// _(INTERNALS)_ A function call.
/// _(internals)_ A function call.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1686,7 +1686,7 @@ impl FloatWrapper<FLOAT> {
}
}
/// _(INTERNALS)_ An expression sub-tree.
/// _(internals)_ An expression sub-tree.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure

View File

@ -46,7 +46,7 @@ mod private {
impl<T: Any + Clone + SendSync> Sealed for T {}
}
/// _(INTERNALS)_ Trait to represent any type.
/// _(internals)_ Trait to represent any type.
/// Exported under the `internals` feature only.
///
/// This trait is sealed and cannot be implemented.
@ -80,7 +80,7 @@ pub trait Variant: Any + private::Sealed {
fn clone_into_dynamic(&self) -> Dynamic;
}
/// _(INTERNALS)_ Trait to represent any type.
/// _(internals)_ Trait to represent any type.
/// Exported under the `internals` feature only.
///
/// This trait is sealed and cannot be implemented.
@ -189,7 +189,7 @@ pub enum Union {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
Float(FloatWrapper<FLOAT>, Tag, AccessMode),
/// _(DECIMAL)_ A fixed-precision decimal value.
/// _(decimal)_ A fixed-precision decimal value.
/// Exported under the `decimal` feature only.
#[cfg(feature = "decimal")]
Decimal(Box<Decimal>, Tag, AccessMode),
@ -222,7 +222,7 @@ pub enum Union {
Shared(crate::Shared<crate::Locked<Dynamic>>, Tag, AccessMode),
}
/// _(INTERNALS)_ Lock guard for reading a [`Dynamic`].
/// _(internals)_ Lock guard for reading a [`Dynamic`].
/// Exported under the `internals` feature only.
///
/// This type provides transparent interoperability between normal [`Dynamic`] and shared
@ -265,7 +265,7 @@ impl<'d, T: Any + Clone> Deref for DynamicReadLock<'d, T> {
}
}
/// _(INTERNALS)_ Lock guard for writing a [`Dynamic`].
/// _(internals)_ Lock guard for writing a [`Dynamic`].
/// Exported under the `internals` feature only.
///
/// This type provides transparent interoperability between normal [`Dynamic`] and shared
@ -1762,7 +1762,7 @@ impl Dynamic {
_ => Err(self.type_name()),
}
}
/// _(DECIMAL)_ Cast the [`Dynamic`] as a [`Decimal`](https://docs.rs/rust_decimal) and return it.
/// _(decimal)_ Cast the [`Dynamic`] as a [`Decimal`](https://docs.rs/rust_decimal) and return it.
/// Returns the name of the actual type if the cast fails.
///
/// Exported under the `decimal` feature only.

View File

@ -40,7 +40,7 @@ use crate::ast::FnCallHashes;
pub type Precedence = NonZeroU8;
/// _(INTERNALS)_ A stack of imported [modules][Module].
/// _(internals)_ A stack of imported [modules][Module].
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -620,7 +620,7 @@ impl<T: Into<Dynamic>> From<T> for Target<'_> {
}
}
/// _(INTERNALS)_ An entry in a function resolution cache.
/// _(internals)_ An entry in a function resolution cache.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -634,7 +634,7 @@ pub struct FnResolutionCacheEntry {
pub source: Option<Identifier>,
}
/// _(INTERNALS)_ A function resolution cache.
/// _(internals)_ A function resolution cache.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -642,7 +642,7 @@ pub struct FnResolutionCacheEntry {
/// This type is volatile and may change.
pub type FnResolutionCache = BTreeMap<u64, Option<Box<FnResolutionCacheEntry>>>;
/// _(INTERNALS)_ A type that holds all the current states of the [`Engine`].
/// _(internals)_ A type that holds all the current states of the [`Engine`].
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -723,7 +723,7 @@ impl EvalState {
}
}
/// _(INTERNALS)_ A type containing all the limits imposed by the [`Engine`].
/// _(internals)_ A type containing all the limits imposed by the [`Engine`].
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -833,7 +833,7 @@ impl<'x, 'px, 'pt> EvalContext<'_, 'x, 'px, '_, '_, '_, '_, 'pt> {
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)> {
self.mods.iter()
}
/// _(INTERNALS)_ The current set of modules imported via `import` statements.
/// _(internals)_ The current set of modules imported via `import` statements.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[cfg(not(feature = "no_module"))]
@ -847,7 +847,7 @@ impl<'x, 'px, 'pt> EvalContext<'_, 'x, 'px, '_, '_, '_, '_, 'pt> {
pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module> {
self.lib.iter().cloned()
}
/// _(INTERNALS)_ The current set of namespaces containing definitions of all script-defined functions.
/// _(internals)_ The current set of namespaces containing definitions of all script-defined functions.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[inline(always)]

View File

@ -2052,7 +2052,7 @@ impl Engine {
let stmt = std::mem::take(ast.statements_mut());
crate::optimize::optimize_into_ast(self, scope, stmt.into_vec(), lib, optimization_level)
}
/// _(METADATA)_ Generate a list of all registered functions.
/// _(metadata)_ Generate a list of all registered functions.
/// Exported under the `metadata` feature only.
///
/// Functions from the following sources are included, in order:

View File

@ -9,7 +9,7 @@ use std::fmt;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
/// _(INTERNALS)_ Error encountered when tokenizing the script text.
/// _(internals)_ Error encountered when tokenizing the script text.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure

View File

@ -98,7 +98,7 @@ impl<'a> NativeCallContext<'a> {
lib,
}
}
/// _(INTERNALS)_ Create a new [`NativeCallContext`].
/// _(internals)_ Create a new [`NativeCallContext`].
/// Exported under the `internals` feature only.
///
/// Not available under `no_module`.
@ -156,7 +156,7 @@ impl<'a> NativeCallContext<'a> {
) -> impl Iterator<Item = (&crate::Identifier, &Shared<Module>)> {
self.mods.iter().flat_map(|&m| m.iter_raw())
}
/// _(INTERNALS)_ The current set of modules imported via `import` statements.
/// _(internals)_ The current set of modules imported via `import` statements.
/// Exported under the `internals` feature only.
///
/// Not available under `no_module`.
@ -172,7 +172,7 @@ impl<'a> NativeCallContext<'a> {
pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module> {
self.lib.iter().cloned()
}
/// _(INTERNALS)_ The current set of namespaces containing definitions of all script-defined functions.
/// _(internals)_ The current set of namespaces containing definitions of all script-defined functions.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[inline(always)]

View File

@ -71,17 +71,17 @@ pub trait RegisterNativeFunction<Args, Result> {
/// Get the type ID's of this function's parameters.
#[must_use]
fn param_types() -> Box<[TypeId]>;
/// _(METADATA)_ Get the type names of this function's parameters.
/// _(metadata)_ Get the type names of this function's parameters.
/// Exported under the `metadata` feature only.
#[cfg(feature = "metadata")]
#[must_use]
fn param_names() -> Box<[&'static str]>;
/// _(METADATA)_ Get the type ID of this function's return value.
/// _(metadata)_ Get the type ID of this function's return value.
/// Exported under the `metadata` feature only.
#[cfg(feature = "metadata")]
#[must_use]
fn return_type() -> TypeId;
/// _(METADATA)_ Get the type name of this function's return value.
/// _(metadata)_ Get the type name of this function's return value.
/// Exported under the `metadata` feature only.
#[cfg(feature = "metadata")]
#[must_use]

View File

@ -278,7 +278,7 @@ pub use module::NamespaceRef;
#[cfg(not(feature = "internals"))]
type StaticVec<T> = smallvec::SmallVec<[T; 4]>;
/// _(INTERNALS)_ Alias to [`smallvec`](https://crates.io/crates/smallvec), which is a specialized
/// _(internals)_ Alias to [`smallvec`](https://crates.io/crates/smallvec), which is a specialized
/// [`Vec`] backed by a small, inline, fixed-size array when there are ≤ 4 items stored.
/// Exported under the `internals` feature only.
///

View File

@ -102,7 +102,7 @@ impl FuncInfo {
}
}
/// _(INTERNALS)_ Calculate a [`u64`] hash key from a namespace-qualified function name and
/// _(internals)_ Calculate a [`u64`] hash key from a namespace-qualified function name and
/// parameter types.
/// Exported under the `internals` feature only.
///
@ -1364,7 +1364,7 @@ impl Module {
.map(|f| (f.namespace, f.access, f.name.as_str(), f.params))
}
/// _(INTERNALS)_ Get an iterator over all script-defined functions in the [`Module`].
/// _(internals)_ Get an iterator over all script-defined functions in the [`Module`].
/// Exported under the `internals` feature only.
///
/// Function metadata includes:
@ -1372,7 +1372,7 @@ impl Module {
/// 2) Access mode ([`FnAccess::Public`] or [`FnAccess::Private`]).
/// 3) Function name (as string slice).
/// 4) Number of parameters.
/// 5) _(INTERNALS)_ Shared reference to function definition [`ScriptFnDef`][crate::ast::ScriptFnDef].
/// 5) _(internals)_ Shared reference to function definition [`ScriptFnDef`][crate::ast::ScriptFnDef].
#[cfg(not(feature = "no_function"))]
#[cfg(feature = "internals")]
#[inline(always)]
@ -1653,7 +1653,7 @@ impl Module {
}
}
/// _(INTERNALS)_ A chain of [module][Module] names to namespace-qualify a variable or function call.
/// _(internals)_ A chain of [module][Module] names to namespace-qualify a variable or function call.
/// Exported under the `internals` feature only.
///
/// A [`u64`] offset to the current [`Scope`][crate::Scope] is cached for quick search purposes.

View File

@ -209,7 +209,7 @@ impl From<&crate::Module> for ModuleMetadata {
#[cfg(feature = "metadata")]
impl Engine {
/// _(METADATA)_ Generate a list of all functions (including those defined in an
/// _(metadata)_ Generate a list of all functions (including those defined in an
/// [`AST`][crate::AST]) in JSON format.
/// Exported under the `metadata` feature only.
///

View File

@ -1,4 +1,4 @@
//! _(SERDE)_ Serialization and deserialization support for [`serde`](https://crates.io/crates/serde).
//! _(serde)_ Serialization and deserialization support for [`serde`](https://crates.io/crates/serde).
//! Exported under the `serde` feature only.
mod de;

View File

@ -27,7 +27,7 @@ use rust_decimal::Decimal;
#[cfg(not(feature = "no_function"))]
use crate::engine::KEYWORD_IS_DEF_FN;
/// _(INTERNALS)_ A type containing commands to control the tokenizer.
/// _(internals)_ A type containing commands to control the tokenizer.
#[derive(Debug, Clone, Eq, PartialEq, Hash, Copy, Default)]
pub struct TokenizerControlBlock {
/// Is the current tokenizer position within an interpolated text string?
@ -35,7 +35,7 @@ pub struct TokenizerControlBlock {
pub is_within_text: bool,
}
/// _(INTERNALS)_ A shared object that allows control of the tokenizer from outside.
/// _(internals)_ A shared object that allows control of the tokenizer from outside.
pub type TokenizerControl = Rc<Cell<TokenizerControlBlock>>;
type LERR = LexError;
@ -283,7 +283,7 @@ impl AddAssign for Position {
}
}
/// _(INTERNALS)_ A Rhai language token.
/// _(internals)_ A Rhai language token.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -980,7 +980,7 @@ impl From<Token> for String {
}
}
/// _(INTERNALS)_ State of the tokenizer.
/// _(internals)_ State of the tokenizer.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1000,7 +1000,7 @@ pub struct TokenizeState {
pub is_within_text_terminated_by: Option<char>,
}
/// _(INTERNALS)_ Trait that encapsulates a peekable character input stream.
/// _(internals)_ Trait that encapsulates a peekable character input stream.
/// Exported under the `internals` feature only.
///
/// # Volatile Data Structure
@ -1018,7 +1018,7 @@ pub trait InputStream {
fn peek_next(&mut self) -> Option<char>;
}
/// _(INTERNALS)_ Parse a string literal ended by `termination_char`.
/// _(internals)_ Parse a string literal ended by `termination_char`.
/// Exported under the `internals` feature only.
///
/// Returns the parsed string and a boolean indicating whether the string is
@ -1310,7 +1310,7 @@ fn scan_block_comment(
level
}
/// _(INTERNALS)_ Get the next token from the `stream`.
/// _(internals)_ Get the next token from the `stream`.
/// Exported under the `internals` feature only.
///
/// # Volatile API
@ -2234,7 +2234,7 @@ impl<'a> Iterator for TokenIterator<'a> {
impl FusedIterator for TokenIterator<'_> {}
impl Engine {
/// _(INTERNALS)_ Tokenize an input text stream.
/// _(internals)_ Tokenize an input text stream.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[inline(always)]
@ -2245,7 +2245,7 @@ impl Engine {
) -> (TokenIterator<'a>, TokenizerControl) {
self.lex_raw(input, None)
}
/// _(INTERNALS)_ Tokenize an input text stream with a mapping function.
/// _(internals)_ Tokenize an input text stream with a mapping function.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[inline(always)]