Enum glsl::syntax::Preprocessor
[−]
[src]
pub enum Preprocessor { Version(PreprocessorVersion), Extension(PreprocessorExtension), }
Some basic preprocessor commands.
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 commands are available for inspection.
Important note: others preprocessor commands can be used in your source. However, they’ll get substituted upfront. For instance, if you use have
#define foo 42
defined in your file, every occurrence tofoo
will get replaced by42
and then treated as a normal GLSL expression (in that case, ending as anExpr::IntConst(42)
value). This might be unfortunate for people seeking minimal size. However, you’re free to use a minifier aftewards to re-enable _that kind of feature. To be honest, it’s not worth it to interleave the AST with preprocessor command annotations just so that the resulting code size is minimal. Just use a minifier.
Variants
Version(PreprocessorVersion)
Extension(PreprocessorExtension)
Trait Implementations
impl Clone for Preprocessor
[src]
fn clone(&self) -> Preprocessor
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Preprocessor
[src]
impl PartialEq for Preprocessor
[src]
fn eq(&self, __arg_0: &Preprocessor) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Preprocessor) -> bool
This method tests for !=
.