Check for missing docs.
This commit is contained in:
parent
0a9457a13d
commit
6ebe002b18
@ -22,7 +22,7 @@ ahash = { version = "0.7", default-features = false }
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
bitflags = { version = "1", default-features = false }
|
||||
smartstring = { version = "1", default-features = false }
|
||||
rhai_codegen = { version = "1.4", path = "codegen", default-features = false }
|
||||
rhai_codegen = { version = "1.4.1", path = "codegen", default-features = false }
|
||||
|
||||
no-std-compat = { version = "0.4", default-features = false, features = ["alloc"], optional = true }
|
||||
libm = { version = "0.2", default-features = false, optional = true }
|
||||
|
@ -34,15 +34,15 @@ pub type OnDebuggerCallback = dyn Fn(EvalContext, DebuggerEvent, ASTNode, Option
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
||||
#[non_exhaustive]
|
||||
pub enum DebuggerCommand {
|
||||
// Continue normal execution.
|
||||
/// Continue normal execution.
|
||||
Continue,
|
||||
// Step into the next expression, diving into functions.
|
||||
/// Step into the next expression, diving into functions.
|
||||
StepInto,
|
||||
// Run to the next expression or statement, stepping over functions.
|
||||
/// Run to the next expression or statement, stepping over functions.
|
||||
StepOver,
|
||||
// Run to the next statement, skipping over functions.
|
||||
/// Run to the next statement, skipping over functions.
|
||||
Next,
|
||||
// Run to the end of the current function call.
|
||||
/// Run to the end of the current function call.
|
||||
FunctionExit,
|
||||
}
|
||||
|
||||
@ -78,17 +78,17 @@ impl DebuggerStatus {
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
pub enum DebuggerEvent<'a> {
|
||||
// Script evaluation starts.
|
||||
/// Script evaluation starts.
|
||||
Start,
|
||||
// Break on next step.
|
||||
/// Break on next step.
|
||||
Step,
|
||||
// Break on break-point.
|
||||
/// Break on break-point.
|
||||
BreakPoint(usize),
|
||||
// Return from a function with a value.
|
||||
/// Return from a function with a value.
|
||||
FunctionExitWithValue(&'a Dynamic),
|
||||
// Return from a function with a value.
|
||||
/// Return from a function with a value.
|
||||
FunctionExitWithError(&'a EvalAltResult),
|
||||
// Script evaluation ends.
|
||||
/// Script evaluation ends.
|
||||
End,
|
||||
}
|
||||
|
||||
@ -103,23 +103,39 @@ pub enum BreakPoint {
|
||||
/// Source is empty if not available.
|
||||
#[cfg(not(feature = "no_position"))]
|
||||
AtPosition {
|
||||
/// Source (empty if not available) of the break-point.
|
||||
source: Identifier,
|
||||
/// [Position] of the break-point.
|
||||
pos: Position,
|
||||
/// Is the break-point enabled?
|
||||
enabled: bool,
|
||||
},
|
||||
/// Break at a particular function call.
|
||||
AtFunctionName { name: Identifier, enabled: bool },
|
||||
AtFunctionName {
|
||||
/// Function name.
|
||||
name: Identifier,
|
||||
/// Is the break-point enabled?
|
||||
enabled: bool,
|
||||
},
|
||||
/// Break at a particular function call with a particular number of arguments.
|
||||
AtFunctionCall {
|
||||
/// Function name.
|
||||
name: Identifier,
|
||||
/// Number of arguments.
|
||||
args: usize,
|
||||
/// Is the break-point enabled?
|
||||
enabled: bool,
|
||||
},
|
||||
/// Break at a particular property .
|
||||
///
|
||||
/// Not available under `no_object`.
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
AtProperty { name: Identifier, enabled: bool },
|
||||
AtProperty {
|
||||
/// Property name.
|
||||
name: Identifier,
|
||||
/// Is the break-point enabled?
|
||||
enabled: bool,
|
||||
},
|
||||
}
|
||||
|
||||
impl fmt::Display for BreakPoint {
|
||||
|
@ -13,6 +13,7 @@ use std::prelude::v1::*;
|
||||
///
|
||||
/// Not available under `no_function`.
|
||||
pub trait Func<ARGS, RET> {
|
||||
/// The closure's output type.
|
||||
type Output;
|
||||
|
||||
/// Create a Rust closure from an [`AST`].
|
||||
|
@ -10,6 +10,7 @@ pub use crate::{
|
||||
use std::prelude::v1::*;
|
||||
pub use std::{any::TypeId, mem};
|
||||
|
||||
/// Result of a Rhai function.
|
||||
pub type RhaiResult = crate::RhaiResult;
|
||||
|
||||
#[cfg(not(features = "no_module"))]
|
||||
|
@ -57,6 +57,7 @@
|
||||
//! See [The Rhai Book](https://rhai.rs/book) for details on the Rhai scripting engine and language.
|
||||
|
||||
#![cfg_attr(feature = "no_std", no_std)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
#[cfg(feature = "no_std")]
|
||||
extern crate alloc;
|
||||
|
@ -97,6 +97,7 @@ macro_rules! def_package {
|
||||
}
|
||||
|
||||
impl $package {
|
||||
#[doc=concat!("Create a new `", stringify!($package), "`")]
|
||||
pub fn new() -> Self {
|
||||
let mut module = $crate::Module::new();
|
||||
<Self as $crate::packages::Package>::init(&mut module);
|
||||
|
@ -292,6 +292,7 @@ pub struct Span {
|
||||
}
|
||||
|
||||
impl Span {
|
||||
/// Empty [`Span`].
|
||||
pub const NONE: Self = Self::new(Position::NONE, Position::NONE);
|
||||
|
||||
/// Create a new [`Span`].
|
||||
@ -862,15 +863,15 @@ impl Token {
|
||||
})
|
||||
}
|
||||
|
||||
// Is this token [`EOF`][Token::EOF]?
|
||||
/// Is this token [`EOF`][Token::EOF]?
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub const fn is_eof(&self) -> bool {
|
||||
matches!(self, Self::EOF)
|
||||
}
|
||||
|
||||
// If another operator is after these, it's probably an unary operator
|
||||
// (not sure about `fn` name).
|
||||
/// If another operator is after these, it's probably a unary operator
|
||||
/// (not sure about `fn` name).
|
||||
#[must_use]
|
||||
pub const fn is_next_unary(&self) -> bool {
|
||||
use Token::*;
|
||||
|
@ -121,8 +121,6 @@ fn test_plugins_package() -> Result<(), Box<EvalAltResult>> {
|
||||
fn test_plugins_parameters() -> Result<(), Box<EvalAltResult>> {
|
||||
#[export_module]
|
||||
mod rhai_std {
|
||||
use rhai::*;
|
||||
|
||||
pub fn noop(_: &str) {}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user