From c825de6f7717571105fa685ffcdddf1e00f70c14 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 25 Jul 2020 16:05:08 +0800 Subject: [PATCH] Mark internal data structures with [INTERNALS]. --- src/engine.rs | 4 ++-- src/error.rs | 2 +- src/module.rs | 2 +- src/parser.rs | 12 ++++++------ src/token.rs | 10 +++++----- src/utils.rs | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/engine.rs b/src/engine.rs index cd87cc1e..a852b3fa 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -38,7 +38,7 @@ pub type Array = Vec; #[cfg(not(feature = "no_object"))] pub type Map = HashMap; -/// A stack of imported modules. +/// [INTERNALS] A stack of imported modules. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -194,7 +194,7 @@ impl> From for Target<'_> { } } -/// 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. /// /// # Safety diff --git a/src/error.rs b/src/error.rs index 736c9df8..b6901c68 100644 --- a/src/error.rs +++ b/src/error.rs @@ -10,7 +10,7 @@ use crate::stdlib::{ string::{String, ToString}, }; -/// Error encountered when tokenizing the script text. +/// [INTERNALS] Error encountered when tokenizing the script text. /// Exported under the `internals` feature only. /// /// ## WARNING diff --git a/src/module.rs b/src/module.rs index 2a590cb8..22632c7d 100644 --- a/src/module.rs +++ b/src/module.rs @@ -1128,7 +1128,7 @@ impl Module { } } -/// A chain of module names to qualify a variable or function call. +/// [INTERNALS] A chain of module names to qualify a variable or function call. /// Exported under the `internals` feature only. /// /// A `u64` hash key is cached for quick search purposes. diff --git a/src/parser.rs b/src/parser.rs index 786f7d85..da0409db 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -342,7 +342,7 @@ impl fmt::Display for FnAccess { } } -/// A type containing information on a scripted function. +/// [INTERNALS] A type containing information on a scripted function. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -381,7 +381,7 @@ impl fmt::Display for ScriptFnDef { } } -/// 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. /// /// ## WARNING @@ -487,7 +487,7 @@ impl ParseSettings { } } -/// A Rhai statement. +/// [INTERNALS] A Rhai statement. /// Exported under the `internals` feature only. /// /// Each variant is at most one pointer in size (for speed), @@ -593,7 +593,7 @@ impl Stmt { } } -/// A type wrapping a custom syntax definition. +/// [INTERNALS] A type wrapping a custom syntax definition. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -614,7 +614,7 @@ impl Hash for CustomExpr { } } -/// A type wrapping a floating-point number. +/// [INTERNALS] A type wrapping a floating-point number. /// Exported under the `internals` feature only. /// /// This type is mainly used to provide a standard `Hash` implementation @@ -635,7 +635,7 @@ impl Hash for FloatWrapper { } } -/// An expression sub-tree. +/// [INTERNALS] An expression sub-tree. /// Exported under the `internals` feature only. /// /// Each variant is at most one pointer in size (for speed), diff --git a/src/token.rs b/src/token.rs index 82e850d5..36e51903 100644 --- a/src/token.rs +++ b/src/token.rs @@ -136,7 +136,7 @@ impl fmt::Debug for Position { } } -/// A language token. +/// [INTERNALS] A Rhai language token. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -681,7 +681,7 @@ impl From for String { } } -/// State of the tokenizer. +/// [INTERNALS] State of the tokenizer. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -701,7 +701,7 @@ pub struct TokenizeState { pub include_comments: bool, } -/// Trait that encapsulates a peekable character input stream. +/// [INTERNALS] Trait that encapsulates a peekable character input stream. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -730,7 +730,7 @@ pub fn is_valid_identifier(name: impl Iterator) -> bool { first_alphabetic } -/// Parse a string literal wrapped by `enclosing_char`. +/// [INTERNALS] Parse a string literal wrapped by `enclosing_char`. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -901,7 +901,7 @@ fn scan_comment( } } -/// Get the next token from the `InputStream`. +/// [INTERNALS] Get the next token from the `InputStream`. /// Exported under the `internals` feature only. /// /// ## WARNING diff --git a/src/utils.rs b/src/utils.rs index 603f8b81..760c809e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -92,7 +92,7 @@ pub fn calc_fn_spec<'a>( s.finish() } -/// An array-like type that holds a number of values in static storage for no-allocation, quick access. +/// [INTERNALS] An array-like type that holds a number of values in static storage for no-allocation, quick access. /// Exported under the `internals` feature only. /// /// If too many items are stored, it converts into using a `Vec`.