Enum glsl_lang::ast::PreprocessorData
source · [−]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
sourceimpl Clone for PreprocessorData
impl Clone for PreprocessorData
sourcefn clone(&self) -> PreprocessorData
fn clone(&self) -> PreprocessorData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PreprocessorData
impl Debug for PreprocessorData
sourceimpl From<Node<PreprocessorData>> for PreprocessorData
impl From<Node<PreprocessorData>> for PreprocessorData
sourcefn from(node: Node<PreprocessorData>) -> PreprocessorData
fn from(node: Node<PreprocessorData>) -> PreprocessorData
Converts to this type from the input type.
sourceimpl NodeContent for PreprocessorData
impl NodeContent for PreprocessorData
sourcefn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
fn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
Convert the contents into a node
sourcefn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
Add span information to a syntax node
sourceimpl NodeContentDisplay for PreprocessorData
impl NodeContentDisplay for PreprocessorData
sourceimpl PartialEq<PreprocessorData> for PreprocessorData
impl PartialEq<PreprocessorData> for PreprocessorData
sourcefn eq(&self, other: &PreprocessorData) -> bool
fn eq(&self, other: &PreprocessorData) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PreprocessorData) -> bool
fn ne(&self, other: &PreprocessorData) -> bool
This method tests for !=
.
impl StructuralPartialEq for PreprocessorData
Auto Trait Implementations
impl RefUnwindSafe for PreprocessorData
impl Send for PreprocessorData
impl Sync for PreprocessorData
impl Unpin for PreprocessorData
impl UnwindSafe for PreprocessorData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> NodeDisplay for T where
T: NodeContentDisplay,
impl<T> NodeDisplay for T where
T: NodeContentDisplay,
sourcefn display(&self) -> NodeDisplayWrapper<'_, T>
fn display(&self) -> NodeDisplayWrapper<'_, T>
Obtain a display wrapper for the current node