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 to foo will get replaced by 42 and then treated as a normal GLSL expression (in that case, ending as an Expr::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

Trait Implementations

impl Clone for Preprocessor
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Preprocessor
[src]

Formats the value using the given formatter.

impl PartialEq for Preprocessor
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.