pub enum PreprocessorError {
Show 25 variants
Endif {
endif_span: Span,
},
NoEndif {
cond_token: Token,
cond_token_span: Span,
},
Elsif {
elsif_span: Span,
},
Else {
else_span: Span,
},
EndKeywords {
end_keywords_span: Span,
},
NoEndKeywords {
begin_keywords_span: Span,
},
InvalidDefineParameter {
other_token: Token,
other_span: Span,
},
InvalidDefineArgument {
other_token: Token,
other_span: Span,
},
InvalidVersionSpecifier {
invalid_version: Token,
invalid_version_span: Span,
},
IncompleteDirective {
directive_span: Span,
},
IncompleteDefine {
other_token: Token,
other_span: Span,
},
UndefinedMacro {
undefined_name: String,
undefined_span: Span,
},
DuplicateMacroParameter {
define_name: String,
param_name: String,
dup_span: Span,
prev_span: Span,
},
NoDefaultAfterDefault {
default_param: String,
default_param_span: Span,
non_default_param: String,
non_default_param_span: Span,
},
NoMacroArguments {
macro_name: String,
define_span: Span,
use_span: Span,
},
TooManyMacroArguments {
macro_name: String,
define_span: Span,
use_span: Span,
expected: usize,
found: usize,
},
MissingMacroArgument {
define_span: Span,
use_span: Span,
param_name: String,
},
InvalidIdentifierFormation {
param_name: String,
arg_span: Span,
},
InvalidRelativeTimescales {
timescale_span: Span,
},
IncompleteMacroWithToken {
error_token: Token,
error_span: Span,
},
Include {
include_path: String,
include_path_span: Span,
read_err: String,
},
IncludeDepth {
include_span: Span,
},
VerboseError {
err: VerboseError,
},
NotPreviouslyDefinedMacro {
macro_name: String,
macro_span: Span,
},
RedefinedMacro {
macro_name: String,
redef_span: Span,
prev_def_span: Span,
},
}Expand description
A wrapper around scarf_parser::PreprocessorError
See its documentation for details on each variant
Variants§
Endif
NoEndif
Fields
cond_token: TokenThe conditional token (either Token::DirIfdef, Token::DirIfndef,
Token::DirElsif, or Token::DirElse) with no matching `endif
Elsif
Else
EndKeywords
NoEndKeywords
InvalidDefineParameter
Fields
InvalidDefineArgument
Fields
InvalidVersionSpecifier
Fields
invalid_version: TokenThe Token provided instead of a valid version specifier
If the token is a Token::StringLiteral, the string isn’t a version recognized
by 1800-2023
IncompleteDirective
Fields
IncompleteDefine
Fields
other_token: TokenIf known, the Token found instead of a valid function macro argument specification
In the case that the token wasn’t tracked, the opening Token::Paren is referenced
instead
UndefinedMacro
Fields
DuplicateMacroParameter
Fields
NoDefaultAfterDefault
Fields
NoMacroArguments
Fields
TooManyMacroArguments
Fields
MissingMacroArgument
Fields
InvalidIdentifierFormation
Fields
InvalidRelativeTimescales
IncompleteMacroWithToken
Fields
error_token: TokenThe error-causing Token (either Token::EParen,
Token::EBracket, or Token::EBrace)
Include
Fields
read_err: StringThe std::io::Error raised when attempting to read the file
IncludeDepth
VerboseError
Fields
err: VerboseErrorThe VerboseError for the preprocessor error
NotPreviouslyDefinedMacro
Fields
RedefinedMacro
Implementations§
Trait Implementations§
Source§impl Clone for PreprocessorError
impl Clone for PreprocessorError
Source§fn clone(&self) -> PreprocessorError
fn clone(&self) -> PreprocessorError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Eq for PreprocessorError
Source§impl<'a> From<PreprocessorError<'a>> for PreprocessorError
impl<'a> From<PreprocessorError<'a>> for PreprocessorError
Source§fn from(value: PreprocessorError<'a>) -> Self
fn from(value: PreprocessorError<'a>) -> Self
Source§impl<'a, 'py> FromPyObject<'a, 'py> for PreprocessorErrorwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for PreprocessorErrorwhere
Self: Clone,
Source§const INPUT_TYPE: PyStaticExpr = <PreprocessorError as ::pyo3::PyTypeInfo>::TYPE_HINT
const INPUT_TYPE: PyStaticExpr = <PreprocessorError as ::pyo3::PyTypeInfo>::TYPE_HINT
Source§type Error = PyClassGuardError<'a, 'py>
type Error = PyClassGuardError<'a, 'py>
Source§impl<'py> IntoPyObject<'py> for PreprocessorError
impl<'py> IntoPyObject<'py> for PreprocessorError
Source§const OUTPUT_TYPE: PyStaticExpr = <PreprocessorError as ::pyo3::PyTypeInfo>::TYPE_HINT
const OUTPUT_TYPE: PyStaticExpr = <PreprocessorError as ::pyo3::PyTypeInfo>::TYPE_HINT
Source§type Target = PreprocessorError
type Target = PreprocessorError
Source§type Output = Bound<'py, <PreprocessorError as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PreprocessorError as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PartialEq for PreprocessorError
impl PartialEq for PreprocessorError
Source§impl PyClass for PreprocessorError
impl PyClass for PreprocessorError
Source§impl PyClassBaseType for PreprocessorError
impl PyClassBaseType for PreprocessorError
type LayoutAsBase = <PreprocessorError as PyClassImpl>::Layout
type BaseNativeType = <PreprocessorError as PyClassImpl>::BaseNativeType
type Initializer = PyClassInitializer<PreprocessorError>
type PyClassMutability = <PreprocessorError as PyClassImpl>::PyClassMutability
Source§type Layout<T: PyClassImpl> = <<PreprocessorError as PyClassBaseType>::BaseNativeType as PyClassBaseType>::Layout<T>
type Layout<T: PyClassImpl> = <<PreprocessorError as PyClassBaseType>::BaseNativeType as PyClassBaseType>::Layout<T>
Source§impl PyClassImpl for PreprocessorError
impl PyClassImpl for PreprocessorError
Source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// A wrapper around [`scarf_parser::PreprocessorError`]
///
/// See its documentation for details on each variant
const RAW_DOC: &'static CStr = /// A wrapper around [`scarf_parser::PreprocessorError`] /// /// See its documentation for details on each variant
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<PreprocessorError as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<PreprocessorError>
type Layout = <<PreprocessorError as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<PreprocessorError>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyMethods<PreprocessorError> for PyClassImplCollector<PreprocessorError>
impl PyMethods<PreprocessorError> for PyClassImplCollector<PreprocessorError>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PreprocessorError
impl PyTypeInfo for PreprocessorError
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§const TYPE_HINT: PyStaticExpr
const TYPE_HINT: PyStaticExpr
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl StructuralPartialEq for PreprocessorError
Auto Trait Implementations§
impl Freeze for PreprocessorError
impl RefUnwindSafe for PreprocessorError
impl Send for PreprocessorError
impl Sync for PreprocessorError
impl Unpin for PreprocessorError
impl UnsafeUnpin for PreprocessorError
impl UnwindSafe for PreprocessorError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);