pub enum PreprocessorData {
Show 14 variants Define(Node<PreprocessorDefineData>), Else, ElseIf(Node<PreprocessorElseIfData>), EndIf, Error(Node<PreprocessorErrorData>), If(Node<PreprocessorIfData>), IfDef(Node<PreprocessorIfDefData>), IfNDef(Node<PreprocessorIfNDefData>), Include(Node<PreprocessorIncludeData>), Line(Node<PreprocessorLineData>), Pragma(Node<PreprocessorPragmaData>), Undef(Node<PreprocessorUndefData>), Version(Node<PreprocessorVersionData>), Extension(Node<PreprocessorExtensionData>),
}
Expand description

Some basic preprocessor directives.

As it’s important to carry them around the AST because they cannot be substituted in a normal preprocessor (they’re used by GPU’s compilers), those preprocessor directives are available for inspection.

Variants§

§

Define(Node<PreprocessorDefineData>)

#define preprocessor directive

§

Else

#else preprocessor directive

§

ElseIf(Node<PreprocessorElseIfData>)

#elseif preprocessor directive

§

EndIf

#endif preprocessor directive

§

Error(Node<PreprocessorErrorData>)

#error preprocessor directive

§

If(Node<PreprocessorIfData>)

#if preprocessor directive

§

IfDef(Node<PreprocessorIfDefData>)

#ifdef preprocessor directive

§

IfNDef(Node<PreprocessorIfNDefData>)

#ifndef preprocessor directive

§

Include(Node<PreprocessorIncludeData>)

#include preprocessor directive

§

Line(Node<PreprocessorLineData>)

#line preprocessor directive

§

Pragma(Node<PreprocessorPragmaData>)

#pragma preprocessor directive

§

Undef(Node<PreprocessorUndefData>)

#undef preprocessor directive

§

Version(Node<PreprocessorVersionData>)

#version preprocessor directive

§

Extension(Node<PreprocessorExtensionData>)

#extension preprocessor directive

Trait Implementations§

source§

impl Clone for PreprocessorData

source§

fn clone(&self) -> PreprocessorData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PreprocessorData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<Node<PreprocessorData>> for PreprocessorData

source§

fn from(node: Node<PreprocessorData>) -> PreprocessorData

Converts to this type from the input type.
source§

impl NodeContent for PreprocessorData

source§

fn into_node<T>(self) -> Node<T>
where T: From<Self> + NodeContent,

Convert the contents into a node
source§

fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>

Add span information to a syntax node
source§

impl NodeContentDisplay for PreprocessorData

source§

fn name() -> Option<&'static str>

Name of the node Read more
source§

fn display_extra(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Display extra information for the node Read more
source§

fn display_children( &self, level: usize, f: &mut Formatter<'_> ) -> Result<(), Error>

Display the node’s children Read more
source§

impl PartialEq for PreprocessorData

source§

fn eq(&self, other: &PreprocessorData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for PreprocessorData

source§

impl StructuralEq for PreprocessorData

source§

impl StructuralPartialEq for PreprocessorData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> NodeDisplay for T

source§

fn name() -> Option<&'static str>

Name of the syntax node’s type
source§

fn start(&self) -> Option<TextSize>

Starting position of the node
source§

fn end(&self) -> Option<TextSize>

Ending position of the node
source§

fn source_id(&self) -> Option<FileId>

Source id of the node
source§

fn display(&self) -> NodeDisplayWrapper<'_, T>

Obtain a display wrapper for the current node
source§

fn display_extra(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Display extra information for the node Read more
source§

fn display_children( &self, level: usize, f: &mut Formatter<'_> ) -> Result<(), Error>

Display the node’s children Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.